Alpag command line options
General | |
-h, --help | print help and quit |
-he, --helpext | print extended help and quit |
-v, --verbose | print detailed messages |
Mode | |
-l, --inlex | input contains lexer and only lexer (assume lex syntax) |
-p, --inpar | input contains parser and only parser (assume yacc syntax) |
-lo, --lexonly | generate lexer only (even if parser definition also present) |
-po, --paronly | generate parser only (even if lexer definition also present) |
-noemit | do not emit result code, just perform analysis |
Output | |
-od, --odir <dir> | base directory for output files |
--obasefile <path> | output code filename for base classes |
--olfile <path> | output code filename for lexer |
--olbasefile <path> | output code filename for lexer-base |
--opfile <path> | output code filename for parser |
--opbasefile <path> | output code filename for parser-base |
Report | |
-rd, --rdir <dir> | parser report directory, '.' - current dir, '=' - same as –odir. Directory for reports is in general different than output directory for code. |
-pr, --prep [<path>] | parser report as text (filename optional) |
-prx, --prxml [<path>] | parser XML report (filename optional) |
-pro, --propts <options> | parser report options, comma separated (see table below, in runtime use –he to get list) |
-lr, --lrep [<path>] | lexer report as text (filename optional) |
-lrx, --lrxml [<path>] | lexer XML report (filename optional) |
-lro, --lropts <options> | lexer report options, comma separated (see table below, in runtime use –he to get list) |
Misc | |
--exopts [<path>] | export options to file and quit (filename optional). |
--warnforce | force enable all warnings, even if explicitly disabled in grammar using directives like %warnoff |
-ienc | input file encoding (see below table with some well known encoding names) |
-oenc | output files encoding (see below table with some well known encoding names) |
Below is a list of possible settings for parser report (-pro). Multiple values can be specified using comma (no spaces allowed between). Options are the same for textual and XML versions of report.
Option | Description |
g | grammar |
gt | grammar - terminals |
gn | grammar - non-terminals |
gp | grammar - productions |
a | automaton, basic information |
ac | automaton and all conflicts |
af | automaton, full information |
rg | reductions groupped |
ast | automaton - states |
ait | automaton - item sets |
ala | automaton - lookahead symbols |
aact | automaton - actions |
c | automaton - conflicts (default) |
ce | automaton - conflicts, only errors |
cew | automaton - conflicts, errors and warnings |
call | automaton - conflicts, all |
cmt | comments |
loc | source file locations |
i | summary info strings |
all | grammar and automaton, basic options 'g,a,cmt' |
allf | grammar and automaton, full options |
By choosing individual settings like g or c user can choose which individual elements should appear in generated report.
Group settings all and allf report all elements with allf being 'full' format. Setting all is the default format, used when no -pro switch is used.
Below is a list of possible settings for lexer report (-lro). Multiple values can be specified using comma (no spaces allowed between). Options are the same for textual and XML versions of report. See comments below the table.
Option | Description |
r | input rules |
rt | input regexes as tree |
m | modes |
mr | rules in each mode |
mrt | mode rule regexes as tree |
es | effective symbols used to build DFA |
er | effective rules used to build DFA |
ert | effective rule regexes as tree |
erc | effective rule regexes with charcodes |
ertc | ert+erc |
s | automaton states |
st | transitions in states |
stg | transitions in states grouped by next state |
stc | transitions with charcodes |
stgc | stg+stc |
rxo | regex tree with outline |
rxt | regex tree with element types |
all | rules, modes, symbols and automaton |
allx | rules, modes, symbols and automaton, expanded |
chars | use charcodes everywhere instead of symbol ids |
By specifying settings like r or m user can choose which individual elements should appear in generated report. Additional settings like mrt specify format used for particular sections.
Group settings all and allx report all elements. The allx setting uses expanded tree-like format for display of regular expressions. Setting all is the default format, used when no -lro switch is used.
By default rules are shown using symbol identifiers instead of particular characters. This makes report compact but less readable. Use chars to show actual character codes in all rules. Note that for grammars with complex character ranges, report generated this way can be prohibitively large.
Try -lro allx,chars to get a lavish version of report.
Disabling certain settings, like tree format of regular expressions (enabled with rt/allx ) disables these features also in XML/ HTML version of report.
Can be used with –ienc, -ioenc command line options.
Encoding | Description |
big5 | Chinese Traditional (Big5) |
cp866 | Cyrillic (DOS) |
csISO2022JP | Japanese (JIS-Allow 1 byte Kana) |
EUC-CN | Chinese Simplified (EUC) |
EUC-JP | Japanese (JIS 0208-1990 and 0212-1990) |
euc-jp | Japanese (EUC) |
euc-kr | Korean (EUC) |
GB18030 | Chinese Simplified (GB18030) |
gb2312 | Chinese Simplified (GB2312) |
hz-gb-2312 | Chinese Simplified (HZ) |
IBM437 | OEM United States |
ibm737 | Greek (DOS) |
ibm775 | Baltic (DOS) |
ibm850 | Western European (DOS) |
ibm852 | Central European (DOS) |
IBM855 | OEM Cyrillic |
ibm857 | Turkish (DOS) |
IBM860 | Portuguese (DOS) |
ibm861 | Icelandic (DOS) |
IBM863 | French Canadian (DOS) |
IBM864 | Arabic (864) |
IBM865 | Nordic (DOS) |
ibm869 | Greek, Modern (DOS) |
iso-2022-jp | Japanese (JIS) |
iso-2022-jp | Japanese (JIS-Allow 1 byte Kana - SO/SI) |
iso-2022-kr | Korean (ISO) |
iso-8859-1 | Western European (ISO) |
iso-8859-13 | Estonian (ISO) |
iso-8859-15 | Latin 9 (ISO) |
iso-8859-2 | Central European (ISO) |
iso-8859-3 | Latin 3 (ISO) |
iso-8859-4 | Baltic (ISO) |
iso-8859-5 | Cyrillic (ISO) |
iso-8859-6 | Arabic (ISO) |
iso-8859-7 | Greek (ISO) |
iso-8859-8 | Hebrew (ISO-Visual) |
iso-8859-8-i | Hebrew (ISO-Logical) |
iso-8859-9 | Turkish (ISO) |
Johab | Korean (Johab) |
koi8-r | Cyrillic (KOI8-R) |
koi8-u | Cyrillic (KOI8-U) |
ks_c_5601-1987 | Korean |
us-ascii | US-ASCII |
utf-16 | Unicode |
utf-16BE | Unicode (Big-Endian) |
utf-32 | Unicode (UTF-32) |
utf-32BE | Unicode (UTF-32 Big-Endian) |
utf-7 | Unicode (UTF-7) |
utf-8 | Unicode (UTF-8) |
windows-1250 | Central European (Windows) |
windows-1251 | Cyrillic (Windows) |
Windows-1252 | Western European (Windows) |
windows-1253 | Greek (Windows) |
windows-1254 | Turkish (Windows) |
windows-1255 | Hebrew (Windows) |
windows-1256 | Arabic (Windows) |
windows-1257 | Baltic (Windows) |
windows-1258 | Vietnamese (Windows) |
windows-874 | Thai (Windows) |