Documentation ¶
Index ¶
- Constants
- func EvalExpr(node parser.Node) ast.Expr
- func EvalExprs(nodes []parser.Node) []ast.Expr
- func GenerateAST(tree []parser.Node) *ast.File
- func GenerateASTFromLispFile(filename string) (*token.FileSet, *ast.File)
- func GenerateASTFromLispString(data string) (*token.FileSet, []ast.Expr)
- func PrintASTFromFile(filename string)
- func PrintASTFromLispString(data string)
- func PrintGoFromFile(filename string)
- func PrintGoFromLispString(data string)
- func WriteASTFromFile(fromFile string, toFile string)
- func WriteGoFromFile(fromFile string, toFile string)
Constants ¶
const ( DefInExpressionError string = "A def within an expression is not allowed" NSInExpressionError string = "A namespace defined in an expression is not allowed" LoopWithoutRecurError string = "There was no recur found in the loop" AssertArgsCountError string = "The assert function requires two arguments" AssrtArgTypeError string = "The assert function's first argument must be a type" MissingCallNodeError string = "Expected call node is missing in root scope" CalleeIndentifierMismatchError string = "Expecting call to identifier (i.e. def, defconst, etc.)" MissingAssgnmentArgsError string = "Expecting expression to be assigned to variable: %q" NSPackageTypeMismatch string = "ns package name needs to be an identifier" InvalidImportError string = "Import declaration is invalid" InvalidImportUseError string = "Use of import is invalid" ExpectingAsInImportError string = "Use of import is invalid; expecting: \":as\"" BinaryArgsCountError string = "Use of binary operator with only one argument is not allowed" UnaryArgsCountError string = "Use of unary operator requires exactly on argument" TooManyArgsError string = "Too many args (%d) were passed to %s; expected %d" TooFewArgsError string = "Too few args (%d) were passed to %s; expected %d" )
Generator-specific error messages
Variables ¶
This section is empty.
Functions ¶
func EvalExprs ¶
EvalExprs is a function that takes a collection of parser nodes and returns a collection of AST expressions.
func GenerateAST ¶
GenerateAST takes a collection of parser nodes and returns an AST file.
func GenerateASTFromLispFile ¶
GenerateASTFromLispFile takes a ZYLISP file and generates the Go AST for it, as an AST file set.
func GenerateASTFromLispString ¶
GenerateASTFromLispString takes a ZYLISP string and generates the Go AST for it and returns both a token file set for it as well as its AST expressions.
func PrintASTFromFile ¶
func PrintASTFromFile(filename string)
PrintASTFromFile takes a filename, generates the Go AST for it, and then prints that AST.
func PrintASTFromLispString ¶
func PrintASTFromLispString(data string)
PrintASTFromLispString takes Lisp data in the form of a string, parses it, and prints the Go AST for it.
func PrintGoFromFile ¶
func PrintGoFromFile(filename string)
PrintGoFromFile takes a filename, generates the Go code for it, and then prints the Go.
func PrintGoFromLispString ¶
func PrintGoFromLispString(data string)
PrintGoFromLispString takes Lisp data in the form of a string, parses it, and prints the generated Go for it.
func WriteASTFromFile ¶
WriteASTFromFile takes an input file and an uutput file, reading Lisp from the former and writing Go AST to the latter.
func WriteGoFromFile ¶
WriteGoFromFile takes an input file and an uutput file, reading Lisp from the former and writing the corresponding Go for it to the latter.
Types ¶
This section is empty.