Documentation ¶
Overview ¶
Package parser implements means to parse ECMAScript code that can be provided by different sources. Subpackages contain a lexer implementation and token types. When creating a parser, a lexer is implicitely created and used.
Package parser implements means to create an AST from a given input source.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error represents an error that occurred while parsing. Inside the parser package, an instance of this struct can be panicked. The panic will be recovered from, and will be propagated to outside the package as a common error. If anything else is panicked, the panic will not be recovered from.
type Parser ¶
type Parser struct { }
Parser parses ECMAScript code and generates an AST that can be evaluated by the runtime.
func (*Parser) Parse ¶
Parse parses frmo the given reader, which will be handled with the given srcName as source name. If this method is used to parse a file, srcName should be the file name.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Code generated by "aststring"; DO NOT EDIT.
|
Code generated by "aststring"; DO NOT EDIT. |
Package matcher implements matchers that efficiently let you determine whether a rune is part of a previously defined rune set.
|
Package matcher implements matchers that efficiently let you determine whether a rune is part of a previously defined rune set. |
Package token contains token types and a token stream implementation that can be used by lexers and parsers.
|
Package token contains token types and a token stream implementation that can be used by lexers and parsers. |