LLK

Command Line Options

LLKMain Options

The main program for LLK is sf.llk.impl.LLKMain. Usage:
	java sf.llk.impl.LLKMain [-options] <grammar.ll>
or simply
	java -jar llk.jar [-options] <grammar.ll>
  • --help|h - Help.
  • --verbose|v - Set verbose mode.
  • --debug modes - Set debug modes. Debug modes is a comma separated string of codegen, follow, lexer, parser, treeparser and on. Whenever debug is on, a stack trace would also be printed for all warnings.
  • --errors n - Suppress error messages after given number of errors, 0=unlimited (default=25).
  • --warns n - Suppress warning messages after given number of warnings, 0=unlimited (default=25).
  • --notrim - Disable grammar optimizations which trim parse tree and merge charSet or tokenSet. Grammar optimization may cause incorrect error locations in error messages (especially with merged charSet or tokenSet which retain location of only one of the merged charSet or tokenSet). Turn this option on would help locating the exact error location in the grammar file.
  • --dir|o dir - Output directory for the generated lexer, parser, treeparser and AST node files.
  • --module string - The package name for the generated classes, this override any module name specified in the grammars. This would not affect the output location for the generated files.
  • --sdir dir - Output directory for the generated support files. If not specified, default to be same as the parser files.
  • --smodule string - The package name for the generated support files. If not specified, default to be same as the parser files.
  • --spath string - Specified a ':' separated search path for looking up files that would not be regenerated if file exists (eg. support files, node files, ... etc). Files that are always regenerated (eg. the visitor) would lookup and generated in the -dir or -sdir locations only. Started from v0.7.0, a special form for the search path that ended with a '.' (eg. sf.llk.share.support.) can be used to specify a package name instead of a directory. LLK would search for binary class (not source file) in the given package through the ClassLoader and prevent the support file from being generated if found.
  • --import string - Import token type definition from the given xml file, overriding grammar options.
  • --pmodule string - The parser module name. If specified, ILLKTreeParserInput and LLKTreeParserInput would add import to the specified module to access ILLKNode. This is required if ILLKNode.java is relocated to outside of the -sdir location.