Eagle Legacy Modernization, LLC

CMD Grammar

Main program: CMD_Program

 Count  Terminals:
8 CMD_Comment: Comment
18,407 CMD_EndOfLine: End of line
6 CMD_Identifier: An identifier
234 CMD_Identifier_Reference: An identifier
162 CMD_Label_Definition: An identifier
56 CMD_Literal: A string enclosed in quotes
309 CMD_Number: A number
178 CMD_PercentVariable: An identifier starting with %%.
30,571 CMD_RawArgument: A string enclosed in quotes
2,831 CMD_RestOfLine: Rest of the line
1,147 CMD_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
18,049 none all all 1.05(11%) 2.31(0%) all CMD_Command: [CMD_EndOfLine] ['@'] CMD_Statement [CMD_Redirect]* [CMD_More_Statements]* CMD_EndOfLine
196 all all 1.05(19%) |   CMD_More_Statements: CMD_Statement_Separator CMD_Statement [CMD_Redirect]*
196 (all) |   |   CMD_Statement_Separator: (("|"|"&&"))
2,067 (1% | 90% | 5% | 5%) |   CMD_Redirect: (CMD_Redirect_Input | CMD_Redirect_Output | CMD_Redirect_Append | CMD_Redirect_Error)
96 all all |   CMD_Redirect_Append: ">>" CMD_Argument
94 all all all |   CMD_Redirect_Error: CMD_Number ">&" CMD_Number
16 all all |   CMD_Redirect_Input: '<' CMD_Argument
1,861 all all |   CMD_Redirect_Output: '>' CMD_Argument
19,135 (1% | 32% | 0% | 0% | 5% | 0% | 15% | 23% | 0% | 6% | 0% | 1% | 0% | 1% | 0% | 4% | 0% | 0% | none | 0% | 0% | 3% | 0% | 6% | 1% | 0%) |   CMD_Statement: (CMD_BlockStatement | CMD_GenericStatement | CMD_Comment | CMD_Awk_Statement | CMD_Call_Statement | CMD_CD_Statement | CMD_Copy_Statement | CMD_Del_Statement | CMD_Dir_Statement | CMD_Echo_Statement | CMD_Exit_Statement | CMD_For_Statement | CMD_GCC_Statement | CMD_Goto_Statement | CMD_Grep_Statement | CMD_If_Statement | CMD_Mkdir_Statement | CMD_NMake_Statement | CMD_Perl_Statement | CMD_Popd_Statement | CMD_Pushd_Statement | CMD_Rem_Statement | CMD_Rmdir_Statement | CMD_Set_Statement | CMD_SetLocal_Statement | CMD_Shift_Statement)
196 all all 1.88 all 14% |   |   CMD_BlockStatement: '(' CMD_EndOfLine CMD_CommandOrLabel* ')' [CMD_IfElse]
369 (all | none) |   |   |   CMD_CommandOrLabel: (CMD_Command | CMD_Label)
28 all all all |   |   |   CMD_IfElse: "else" ['@'] CMD_Statement
6,104 all 2.28(71%) |   |   CMD_GenericStatement: CMD_Argument [CMD_GenericArgument]*
9,942 (89% | 11%) |   |   |   CMD_GenericArgument: (CMD_Argument | ("-"|"/"))
10 all all all CMD_Expression: CMD_Expr_Item '+' CMD_Expr_Item
20 (50% | 50%) |   CMD_Expr_Item: (CMD_Number | CMD_Identifier_Reference)
518 34.44(all) CMD_Program: [CMD_CommandOrLabelOrUnparsed]*
17,842 (99% | 1% | none) |   CMD_CommandOrLabelOrUnparsed: (CMD_Command | CMD_Label | CMD_Unparsed_Statement)
162 all all all |   CMD_Label: ':' CMD_Label_Definition CMD_EndOfLine
56 all 1.16(68%) 1.20(63%) CMD_Awk_Statement: "awk" [CMD_Awk_Option]* [CMD_Argument]*
44 (86% | 14%) |   CMD_Awk_Option: (CMD_Awk_Option_F | CMD_Awk_Option_V)
38 all all all |   |   CMD_Awk_Option_F: '-' "f" CMD_Argument
6 all all all |   |   CMD_Awk_Option_V: '-' "v" CMD_Argument
10 all none all CMD_CD_Statement: "cd" [CMD_CD_Option]* CMD_Argument
    |   CMD_CD_Option: (CMD_CD_Option_D)
    |   |   CMD_CD_Option_D: '/' "d"
1,001 all 2% all 2.58(88%) CMD_Call_Statement: "call" [':'] CMD_Argument [CMD_Call_Parameter]*
2,272 (3% | 0% | 97%) |   CMD_Call_Parameter: (CMD_Call_Minus_Option | CMD_Call_Slash_Option | CMD_Argument)
69 all all |   |   CMD_Call_Minus_Option: '-' CMD_Argument
2 all all |   |   CMD_Call_Slash_Option: '/' CMD_Argument
2,850 all 1.00(2%) all 55% CMD_Copy_Statement: "copy" [CMD_Copy_Option]* CMD_Argument [CMD_Argument]
56 (all) |   CMD_Copy_Option: (CMD_Copy_Option_Y)
56 all all |   |   CMD_Copy_Option_Y: '/' "y"
4,427 all 1.02(1%) 1.00 CMD_Del_Statement: "del" [CMD_Del_Option]* CMD_Argument*
59 (97% | 2% | 2%) |   CMD_Del_Option: (CMD_Del_Option_F | CMD_Del_Option_Q | CMD_Del_Option_S)
57 all all |   |   CMD_Del_Option_F: '/' "f"
1 all all |   |   CMD_Del_Option_Q: '/' "q"
1 all all |   |   CMD_Del_Option_S: '/' "s"
79 all 1.09(57%) 1.44 CMD_Dir_Statement: "dir" [CMD_Dir_Option]* CMD_Argument*
49 (4% | 27% | none | 69%) |   CMD_Dir_Option: (CMD_Dir_Option_A | CMD_Dir_Option_B | CMD_Dir_Option_O | CMD_Dir_Option_S)
2 all all all all |   |   CMD_Dir_Option_A: '/' "a" ':' ("h"|"r")
13 all all |   |   CMD_Dir_Option_B: '/' "b"
    |   |   CMD_Dir_Option_O: '/' "o" ':' "d"
34 all all |   |   CMD_Dir_Option_S: '/' "s"
1,068 all 18% all CMD_Echo_Statement: "echo" ['.'] CMD_RestOfLine
5 all 1.00(all) all CMD_Exit_Statement: "exit" [CMD_Exit_Option]* [CMD_Number]
5 (all) |   CMD_Exit_Option: (CMD_Exit_Option_B)
5 all all |   |   CMD_Exit_Option_B: '/' "b"
178 all 1.05(87%) all all all all 3.30(11%) all all all all CMD_For_Statement: "for" [CMD_For_Option]* CMD_PercentVariable "in" '(' CMD_Argument [CMD_For_More_Params]* ')' "do" ['@'] CMD_Statement
66 none all |   CMD_For_More_Params: [','] CMD_Argument
162 (9% | 30% | 7% | 54%) |   CMD_For_Option: (CMD_For_Option_D | CMD_For_Option_F | CMD_For_Option_L | CMD_For_Option_R)
14 all all |   |   CMD_For_Option_D: '/' "d"
48 all all 65% |   |   CMD_For_Option_F: '/' "f" [CMD_Literal]
12 all all |   |   CMD_For_Option_L: '/' "l"
88 all all 40% |   |   CMD_For_Option_R: '/' "r" [CMD_For_R]
35 (11% | 71% | 17%) |   |   |   CMD_For_R: (CMD_For_R_pct | CMD_Literal | CMD_Identifier)
4 all all |   |   |   |   CMD_For_R_pct: '%' CMD_Number
2 all 5.00 CMD_GCC_Statement: "gcc" CMD_GCC_Parameter*
10 (20% | 80%) |   CMD_GCC_Parameter: (CMD_GCC_Option_O | CMD_Argument)
2 all all all |   |   CMD_GCC_Option_O: '-' "o" CMD_Argument
224 all 38% all CMD_Goto_Statement: "goto" [':'] CMD_Goto_What
224 (all | none) |   CMD_Goto_What: (CMD_Identifier_Reference | "eof")
67 all 2.03 CMD_Grep_Statement: "grep" CMD_Grep_Parameter*
136 (5% | 3% | 3% | none | 5% | 15% | 1% | 68%) |   CMD_Grep_Parameter: (CMD_Grep_Option_H | CMD_Grep_Option_e | CMD_Grep_Option_i | CMD_Grep_Option_l | CMD_Grep_Option_n | CMD_Grep_Option_v | CMD_Grep_Option_w | CMD_Argument)
7 all all |   |   CMD_Grep_Option_H: '-' "H"
4 all all all |   |   CMD_Grep_Option_e: '-' "e" CMD_Argument
4 all all |   |   CMD_Grep_Option_i: '-' "i"
    |   |   CMD_Grep_Option_l: '-' "l"
7 all all |   |   CMD_Grep_Option_n: '-' "n"
20 all all |   |   CMD_Grep_Option_v: '-' "v"
1 all all |   |   CMD_Grep_Option_w: '-' "w"
684 all all all all all CMD_If_Statement: "if" ["not"] CMD_IfWhat ['@'] CMD_Statement
684 (1% | 6% | 37% | 15% | 41% | none) |   CMD_IfWhat: (CMD_IfCondition | CMD_IfDefined | CMD_IfEqual | CMD_IfErrorLevel | CMD_IfExist | CMD_Literal)
8 all |   |   CMD_IfCondition: CMD_Argument
44 all all |   |   CMD_IfDefined: "defined" CMD_Argument
251 all all all |   |   CMD_IfEqual: CMD_Argument CMD_IfOperator CMD_Argument
251 (99% | 1%) |   |   |   CMD_IfOperator: (CMD_EqualsEquals | ("equ"|"geq"|"gtr"|"leq"|"lss"|"neq"))
249 all none |   |   |   |   CMD_EqualsEquals: "==" ['-']
102 all all |   |   CMD_IfErrorLevel: "errorlevel" CMD_Number
279 all all |   |   CMD_IfExist: "exist" CMD_Argument
44 all all CMD_Mkdir_Statement: "mkdir" CMD_Argument
14 all 5.71 CMD_NMake_Statement: "nmake" CMD_NMake_Parameter*
80 (18% | 18% | 15% | 15% | 35%) |   CMD_NMake_Parameter: (CMD_NMake_Option_E | CMD_NMake_Option_F | CMD_NMake_Option_I | CMD_NMake_Option_K | CMD_Argument)
14 all all |   |   CMD_NMake_Option_E: '/' "e"
14 all all all |   |   CMD_NMake_Option_F: '/' "f" CMD_Argument
12 all all |   |   CMD_NMake_Option_I: '/' "i"
12 all all |   |   CMD_NMake_Option_K: '/' "k"
    CMD_Perl_Statement: "perl" [CMD_Perl_Option]* CMD_Argument* CMD_EndOfLine CMD_Goto_Statement CMD_EndOfLine ['@'] CMD_Rem_Statement CMD_EndOfLine Perl_Program "__END__"
    |   CMD_Perl_Option: (CMD_Perl_Option_E)
    |   |   CMD_Perl_Option_E: '-' "e"
55 all CMD_Popd_Statement: "popd"
54 all all CMD_Pushd_Statement: "pushd" CMD_Argument
626 all all CMD_Rem_Statement: "rem" CMD_RestOfLine
25 all 1.95(84%) all CMD_Rmdir_Statement: "rmdir" [CMD_Rmdir_Option]* CMD_Argument
41 (51% | 49%) |   CMD_Rmdir_Option: (CMD_Rmdir_Option_Q | CMD_Rmdir_Option_S)
21 all all |   |   CMD_Rmdir_Option_Q: '/' "q"
20 all all |   |   CMD_Rmdir_Option_S: '/' "s"
206 all CMD_SetLocal_Statement: "setlocal"
1,147 all all CMD_Set_Statement: "set" CMD_Set_What
1,147 (1% | none | 99%) |   CMD_Set_What: (CMD_Set_Assigment | CMD_Set_Prompt | CMS_Set_Regular)
10 all all all all all |   |   CMD_Set_Assigment: '/' "a" CMD_Variable_Definition '=' CMD_Expression
    |   |   CMD_Set_Prompt: '/' "p" CMD_Variable_Definition '=' CMD_RestOfLine
1,137 all all all |   |   CMS_Set_Regular: CMD_Variable_Definition '=' CMD_RestOfLine
5 all none CMD_Shift_Statement: "shift" [CMD_Number]
    CMD_Unparsed_Statement: CMD_UnparsedElement* CMD_EndOfLine
    |   CMD_UnparsedElement: (CMD_Identifier_Reference | ("%"|"."|","|"="|"("|")"|"["|"]") | CMD_Literal | CMD_Number | CMD_Comment)
30,571 all CMD_Argument: CMD_ArgumentWrapper
30,571 (all) |   CMD_ArgumentWrapper: (CMD_RawArgument)

Terminals = 11 (instances=53,909)
Tokens = 108 (instances=158,859)

(*) Statistics are shown in the same order as the Tokens.
Percentages are rounded; 'all' and 'none' mean 100% and 0% before rounding.
For lists, it shows the average number of occurrences, excluding empty lists.