Code Generation

This is the backend of Comonicon. Currently it can only generates a Julia AST.

References

Comonicon.CodeGen.codegenMethod
codegen(cmd)

Generate Julia AST from given command object cmd. This will wrap all the generated AST in a function command_main.

source
Comonicon.CodeGen.xerrorMethod
xerror(cmd, msg)

Create an expression that contains error message, automatically merge interpolation expressions.

source
Comonicon.CodeGen.xmatchFunction
xmatch(regexes, actions, str[, st = 1])

Generate a long ifelse expression that acts like a pattern matching expression that match given regex list and do the corresponding actions.

source