Documentation ¶
Overview ¶
Package example defines an example language.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateLexer ¶
CreateLexer returns a new lexer with the language definitions already registered.
func CreateSimpleAdderFunc ¶
func CreateSimpleAdderFunc() string
CreateSimpleAdderFunc returns source code for an example function definition
func ParserProcessor ¶
ParserProcessor returns the processor for the example language
Types ¶
type StringSourceOperation ¶
type StringSourceOperation struct {
Src string
}
StringSourceOperation is a lexer operation that can be used to tokenize a string as source code
func (*StringSourceOperation) Finish ¶
func (o *StringSourceOperation) Finish() error
Finish is called after the tokenization is completed
This method is even called after errors, and in that case any error returned by this function will de discarded
func (*StringSourceOperation) ID ¶
func (o *StringSourceOperation) ID() string
ID returns a unique identifier for the source code
func (*StringSourceOperation) Prepare ¶
func (o *StringSourceOperation) Prepare() error
Prepare is called before the tokenization begins
func (*StringSourceOperation) SourceReader ¶
func (o *StringSourceOperation) SourceReader() io.Reader
SourceReader returns the reader for the source code