fe

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 11 Imported by: 0

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

func Frontend(hooks trans.HookMap, opts *FrontendOptions) ictiobus.Frontend[syntax.AST]

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

func Grammar() grammar.CFG

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.

func Lexer added in v0.7.0

func Lexer(lazy bool) lex.Lexer

Lexer returns the generated ictiobus Lexer for FISHI.

func Parser added in v0.7.0

func Parser() parse.Parser

Parser returns the generated ictiobus Parser for FISHI.

func SDTS added in v0.7.0

func SDTS() trans.SDTS

SDTS returns the generated ictiobus syntax-directed translation scheme for FISHI.

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.

Directories

Path Synopsis
Package fetoken contains the token classes used by the frontend of FISHI.
Package fetoken contains the token classes used by the frontend of FISHI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL