Documentation ¶
Overview ¶
Package fe contains the frontend for analyzing FISHI code. The function Frontend is the primary entrypoint for callers, and will return a full FISHI frontend ready for immediate use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Frontend ¶
Frontend returns the complete compiled frontend for the FISHI langauge. The hooks map must be provided as it is the interface between the translation scheme in the frontend and the external code executed in the backend. The opts parameter allows options to be set on the frontend for debugging and other purposes. If opts is nil, it is treated as an empty FrontendOptions.
func Grammar ¶ added in v0.7.0
Grammar returns the grammar accepted by the generated ictiobus parser for FISHI. This grammar will also be included with with the parser itself, but it is included here as well for convenience.
Types ¶
type FrontendOptions ¶
type FrontendOptions struct { // LexerEager is whether the Lexer should immediately read all input the // first time it is called. The default is lazy lexing, where the minimum // number of tokens are read when required by the parser. LexerEager bool // LexerTrace is whether to add tracing functionality to the lexer. This // will cause the tokens to be printed to stderr as they are lexed. Note // that with LexerEager set, this implies that they will all be lexed and // therefore printed before any parsing occurs. LexerTrace bool // ParserTrace is whether to add tracing functionality to the parser. This // will cause parsing events to be printed to stderr as they occur. This // includes operations such as token or symbol stack manipulation, and for // LR parsers, shifts and reduces. ParserTrace bool // SDTSTrace is whether to add tracing functionality to the translation // scheme. This will cause translation events to be printed to stderr as // they occur. This includes operations such as parse tree annotation and // hook execution. SDTSTrace bool }
FrontendOptions allows options to be set on the compiler frontend returned by Frontend. It allows setting of debug flags and other optional functionality.