Eagle Legacy Modernization, LLC

CMD Grammar

Main program: CMD_Program

 Count  Terminals:
8 CMD_Comment: Comment
16,892 CMD_EndOfLine: End of line
3 CMD_Identifier: An identifier
213 CMD_Identifier_Reference: An identifier
147 CMD_Label_Definition: An identifier
52 CMD_Literal: A string enclosed in quotes
163 CMD_Number: A number
136 CMD_PercentVariable: An identifier starting with %%.
27,982 CMD_RawArgument: A string enclosed in quotes
2,112 CMD_RestOfLine: Rest of the line
866 CMD_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
16,590 none all all 1.03(11%) 2.31(0%) all CMD_Command: [CMD_EndOfLine] ['@'] CMD_Statement [CMD_Redirect]* [CMD_More_Statements]* CMD_EndOfLine
180 all all 1.00(19%) |   CMD_More_Statements: CMD_Statement_Separator CMD_Statement [CMD_Redirect]*
180 (all) |   |   CMD_Statement_Separator: (("|"|"&&"))
1,910 (0% | 94% | 2% | 3%) |   CMD_Redirect: (CMD_Redirect_Input | CMD_Redirect_Output | CMD_Redirect_Append | CMD_Redirect_Error)
47 all all |   CMD_Redirect_Append: ">>" CMD_Argument
52 all all all |   CMD_Redirect_Error: CMD_Number ">&" CMD_Number
9 all all |   CMD_Redirect_Input: '<' CMD_Argument
1,802 all all |   CMD_Redirect_Output: '>' CMD_Argument
17,432 (1% | 33% | 0% | 0% | 5% | 0% | 16% | 25% | 0% | 4% | none | 1% | 0% | 1% | 0% | 3% | 0% | 0% | none | 0% | 0% | 3% | 0% | 5% | 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)
155 all all 2.05 all 15% |   |   CMD_BlockStatement: '(' CMD_EndOfLine CMD_CommandOrLabel* ')' [CMD_IfElse]
317 (all | none) |   |   |   CMD_CommandOrLabel: (CMD_Command | CMD_Label)
24 all all all |   |   |   CMD_IfElse: "else" ['@'] CMD_Statement
5,724 all 2.08(70%) |   |   CMD_GenericStatement: CMD_Argument [CMD_GenericArgument]*
8,298 (91% | 9%) |   |   |   CMD_GenericArgument: (CMD_Argument | ("-"|"/"))
9 all all all CMD_Expression: CMD_Expr_Item '+' CMD_Expr_Item
18 (50% | 50%) |   CMD_Expr_Item: (CMD_Number | CMD_Identifier_Reference)
396 41.46(all) CMD_Program: [CMD_CommandOrLabelOrUnparsed]*
16,420 (99% | 1% | none) |   CMD_CommandOrLabelOrUnparsed: (CMD_Command | CMD_Label | CMD_Unparsed_Statement)
147 all all all |   CMD_Label: ':' CMD_Label_Definition CMD_EndOfLine
55 all 1.17(65%) 1.24(62%) CMD_Awk_Statement: "awk" [CMD_Awk_Option]* [CMD_Argument]*
42 (86% | 14%) |   CMD_Awk_Option: (CMD_Awk_Option_F | CMD_Awk_Option_V)
36 all all all |   |   CMD_Awk_Option_F: '-' "f" CMD_Argument
6 all all all |   |   CMD_Awk_Option_V: '-' "v" CMD_Argument
5 all none all CMD_CD_Statement: "cd" [CMD_CD_Option]* CMD_Argument
    |   CMD_CD_Option: (CMD_CD_Option_D)
    |   |   CMD_CD_Option_D: '/' "d"
878 all 2% all 2.61(91%) CMD_Call_Statement: "call" [':'] CMD_Argument [CMD_Call_Parameter]*
2,074 (1% | 0% | 99%) |   CMD_Call_Parameter: (CMD_Call_Minus_Option | CMD_Call_Slash_Option | CMD_Argument)
11 all all |   |   CMD_Call_Minus_Option: '-' CMD_Argument
2 all all |   |   CMD_Call_Slash_Option: '/' CMD_Argument
2,793 all 1.00(1%) all 54% CMD_Copy_Statement: "copy" [CMD_Copy_Option]* CMD_Argument [CMD_Argument]
27 (all) |   CMD_Copy_Option: (CMD_Copy_Option_Y)
27 all all |   |   CMD_Copy_Option_Y: '/' "y"
4,401 all 1.00(1%) 1.00 CMD_Del_Statement: "del" [CMD_Del_Option]* CMD_Argument*
34 (97% | none | 3%) |   CMD_Del_Option: (CMD_Del_Option_F | CMD_Del_Option_Q | CMD_Del_Option_S)
33 all all |   |   CMD_Del_Option_F: '/' "f"
    |   |   CMD_Del_Option_Q: '/' "q"
1 all all |   |   CMD_Del_Option_S: '/' "s"
70 all 1.11(67%) 1.50 CMD_Dir_Statement: "dir" [CMD_Dir_Option]* CMD_Argument*
52 (6% | 25% | none | 69%) |   CMD_Dir_Option: (CMD_Dir_Option_A | CMD_Dir_Option_B | CMD_Dir_Option_O | CMD_Dir_Option_S)
3 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"
36 all all |   |   CMD_Dir_Option_S: '/' "s"
739 all 14% all CMD_Echo_Statement: "echo" ['.'] CMD_RestOfLine
    CMD_Exit_Statement: "exit" [CMD_Exit_Option]* [CMD_Number]
    |   CMD_Exit_Option: (CMD_Exit_Option_B)
    |   |   CMD_Exit_Option_B: '/' "b"
136 all 1.05(85%) all all all all 2.24(13%) all all all all CMD_For_Statement: "for" [CMD_For_Option]* CMD_PercentVariable "in" '(' CMD_Argument [CMD_For_More_Params]* ')' "do" ['@'] CMD_Statement
38 none all |   CMD_For_More_Params: [','] CMD_Argument
121 (9% | 36% | 4% | 51%) |   CMD_For_Option: (CMD_For_Option_D | CMD_For_Option_F | CMD_For_Option_L | CMD_For_Option_R)
11 all all |   |   CMD_For_Option_D: '/' "d"
43 all all 63% |   |   CMD_For_Option_F: '/' "f" [CMD_Literal]
5 all all |   |   CMD_For_Option_L: '/' "l"
62 all all 52% |   |   CMD_For_Option_R: '/' "r" [CMD_For_R]
32 (13% | 78% | 9%) |   |   |   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
204 all 34% all CMD_Goto_Statement: "goto" [':'] CMD_Goto_What
204 (all | none) |   CMD_Goto_What: (CMD_Identifier_Reference | "eof")
59 all 2.02 CMD_Grep_Statement: "grep" CMD_Grep_Parameter*
119 (5% | 4% | 3% | none | 5% | 14% | 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)
6 all all |   |   CMD_Grep_Option_H: '-' "H"
5 all all all |   |   CMD_Grep_Option_e: '-' "e" CMD_Argument
3 all all |   |   CMD_Grep_Option_i: '-' "i"
    |   |   CMD_Grep_Option_l: '-' "l"
6 all all |   |   CMD_Grep_Option_n: '-' "n"
17 all all |   |   CMD_Grep_Option_v: '-' "v"
1 all all |   |   CMD_Grep_Option_w: '-' "w"
502 all all all all all CMD_If_Statement: "if" ["not"] CMD_IfWhat ['@'] CMD_Statement
502 (2% | 7% | 39% | 9% | 43% | none) |   CMD_IfWhat: (CMD_IfCondition | CMD_IfDefined | CMD_IfEqual | CMD_IfErrorLevel | CMD_IfExist | CMD_Literal)
8 all |   |   CMD_IfCondition: CMD_Argument
36 all all |   |   CMD_IfDefined: "defined" CMD_Argument
197 all all all |   |   CMD_IfEqual: CMD_Argument CMD_IfOperator CMD_Argument
197 (all | none) |   |   |   CMD_IfOperator: (CMD_EqualsEquals | ("equ"|"geq"|"gtr"|"leq"|"lss"|"neq"))
197 all none |   |   |   |   CMD_EqualsEquals: "==" ['-']
46 all all |   |   CMD_IfErrorLevel: "errorlevel" CMD_Number
215 all all |   |   CMD_IfExist: "exist" CMD_Argument
27 all all CMD_Mkdir_Statement: "mkdir" CMD_Argument
7 all 5.71 CMD_NMake_Statement: "nmake" CMD_NMake_Parameter*
40 (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)
7 all all |   |   CMD_NMake_Option_E: '/' "e"
7 all all all |   |   CMD_NMake_Option_F: '/' "f" CMD_Argument
6 all all |   |   CMD_NMake_Option_I: '/' "i"
6 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"
43 all CMD_Popd_Statement: "popd"
43 all all CMD_Pushd_Statement: "pushd" CMD_Argument
516 all all CMD_Rem_Statement: "rem" CMD_RestOfLine
15 all 1.82(73%) all CMD_Rmdir_Statement: "rmdir" [CMD_Rmdir_Option]* CMD_Argument
20 (55% | 45%) |   CMD_Rmdir_Option: (CMD_Rmdir_Option_Q | CMD_Rmdir_Option_S)
11 all all |   |   CMD_Rmdir_Option_Q: '/' "q"
9 all all |   |   CMD_Rmdir_Option_S: '/' "s"
179 all CMD_SetLocal_Statement: "setlocal"
866 all all CMD_Set_Statement: "set" CMD_Set_What
866 (1% | 0% | 99%) |   CMD_Set_What: (CMD_Set_Assigment | CMD_Set_Prompt | CMS_Set_Regular)
9 all all all all all |   |   CMD_Set_Assigment: '/' "a" CMD_Variable_Definition '=' CMD_Expression
1 all all all all all |   |   CMD_Set_Prompt: '/' "p" CMD_Variable_Definition '=' CMD_RestOfLine
856 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)
27,982 all CMD_Argument: CMD_ArgumentWrapper
27,982 (all) |   CMD_ArgumentWrapper: (CMD_RawArgument)

Terminals = 11 (instances=48,574)
Tokens = 108 (instances=143,541)

(*) 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.