Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func XPathGrammar ¶
Types ¶
type XPathLexer ¶
type XPathLexer struct { Input string Tokens chan *XPathToken // contains filtered or unexported fields }
func (*XPathLexer) Run ¶
func (l *XPathLexer) Run()
type XPathToken ¶
type XPathToken struct { Token_Type XPathTokenType Value string }
func (*XPathToken) AsValue ¶
func (t *XPathToken) AsValue() string
func (*XPathToken) TokenType ¶
func (t *XPathToken) TokenType() int
type XPathTokenType ¶
type XPathTokenType int
lex terminal - default state
-- if quote, lex string -- if (:, lex comment -- recognize delimiting operators as token -- skip whitespace
lex identifier
-- accept NCName characters -- if next char is :, switch to lex QName -- if token is keyword, emit keyword token else emit NCName -- switch to lex terminal
lex QName
-- accept NCName characters -- switch to lex terminal
const ( TT_END XPathTokenType = iota TT_INT //integer literal TT_DECIMAL //decimal literal TT_DOUBLE //double literal TT_STRING //string literal (may contain escaped quotes) TT_NCNAME // NCName (valid XML name) see http://www.w3.org/TR/REC-xml-names/#NT-NCName TT_QNAME // QName (namespace-qualified name) see http://www.w3.org/TR/REC-xml-names/#NT-QName TT_KEYWORD // as defined in http://www.w3.org/TR/xpath20/#id-terminal-delimitation TT_TERMINAL // other terminal symbol (mostly punctuation) )
Click to show internal directories.
Click to hide internal directories.