Eagle Legacy Modernization, LLC

IntelASM Grammar

Main program: IntelASM_Program

IntelASM syntax:

 Count  Terminals:
153 IntelASM_Comment: ; or // comment to end of line
  IntelASM_CommentToEndOfLine: comment to end of line
  IntelASM_Define_Definition: An identifier
690 IntelASM_EndOfLine: End of line
  IntelASM_HexNumber: A hex number
277 IntelASM_Identifier_Reference: An identifier
136 IntelASM_Label_Definition: An identifier
134 IntelASM_Label_Reference: An identifier
70 IntelASM_Literal: quotes:'" escape:none doubled:no multiline:no
  IntelASM_Macro_Definition: An identifier
136 IntelASM_Number: exponent_chars:none suffix_chars:none trailing_period:no ignore_char:none
 Count  Statistics(*) Tokens:
    IntelASM_CpuDirective: "cpu" IntelASM_CPUValue*
    |   IntelASM_CPUValue: ("MMX"|"SSE"|"SSE2"|"SSE3"|"SSSE3")
    IntelASM_DefineDirective: '%' "define" IntelASM_Define_Definition [IntelASM_Identifier_Reference]
20 all 5% all all IntelASM_EquDirective: IntelASM_Label_Definition [':'] "EQU" IntelASM_Expression
2 all all IntelASM_GlobalDirective: "GLOBAL" IntelASM_Identifier_Reference
    IntelASM_IncludeDirective: ['%'] "include" IntelASM_Filename
    |   IntelASM_Filename: (IntelASM_BareFilename | IntelASM_Literal)
    |   |   IntelASM_BareFilename: IntelASM_Identifier_Reference*
    IntelASM_ListDirective: '.' ("list"|"xlist")
    IntelASM_MacroDirective: '%' "macro" IntelASM_Macro_Definition IntelASM_Number IntelASM_EndOfLine IntelASM_Line* IntelASM_EndMacro
    |   IntelASM_EndMacro: '%' "endmacro"
5 all all IntelASM_SectionDirective: ("SECTION"|"SECTION_TEXT") [(".data"|".rodata"|".text")]
    IntelASM_TitleDirective: "TITLE" IntelASM_CommentToEndOfLine
74 all all all IntelASM_AdditiveExpression: IntelASM_Expression ("+"|"-") IntelASM_Expression
79 all all all IntelASM_Brackets: '[' IntelASM_Expression ']'
    IntelASM_BytePtr: "BYTE" "PTR" IntelASM_Expression
24 all IntelASM_Dollar: '$'
    IntelASM_DwordPtr: "DWORD" "PTR" '[' IntelASM_Expression ']'
24 all all all IntelASM_MultiplicativeExpression: IntelASM_Expression ("*") IntelASM_Expression
77 all IntelASM_RegisterExpr: IntelASM_Register
254 all IntelASM_VariableExpr: IntelASM_Identifier_Reference
95 all all IntelASM_CALL: "CALL" IntelASM_Label_Reference
32 all all all all IntelASM_CMP: "CMP" IntelASM_Register ',' IntelASM_Expression
53 4% all 1.08 IntelASM_DB: [IntelASM_DBtimes] "DB" IntelASM_Expression*
2 all all |   IntelASM_DBtimes: "TIMES" IntelASM_Number
17 all 8.06 IntelASM_DQ: "DQ" IntelASM_Expression*
39 all all IntelASM_JMP: ("JC"|"JE"|"JG"|"JGE"|"JL"|"JLE"|"JMP"|"JNE"|"JNZ"|"JZ") IntelASM_Label_Reference
15 all IntelASM_NoArgs: ("CLD"|"LODSB"|"MOVSB"|"NOP"|"RET"|"STD"|"STOSB")
29 all all IntelASM_OneArg: ("DEC"|"DIV"|"INC"|"MUL"|"NEG"|"POP"|"PUSH"|"REP"|"REPZ"|"SETZ") IntelASM_Register
    IntelASM_REPNE: "REPNE" "SCASB"
5 all IntelASM_SysCall: "SYSCALL"
277 all all all all IntelASM_TwoArgs: ("ADD"|"AND"|"LEA"|"MOV"|"MOVSX"|"MOVZX"|"OR"|"SHL"|"SHR"|"SUB"|"TEST"|"XOR") IntelASM_Variable ',' IntelASM_Expression
27 all all IntelASM_Directive: IntelASM_DirectiveList IntelASM_EndOfLine
27 (none | none | 74% | 7% | none | none | none | 19% | none) |   IntelASM_DirectiveList: (IntelASM_CpuDirective | IntelASM_DefineDirective | IntelASM_EquDirective | IntelASM_GlobalDirective | IntelASM_IncludeDirective | IntelASM_ListDirective | IntelASM_MacroDirective | IntelASM_SectionDirective | IntelASM_TitleDirective)
736 (none | 18% | 10% | 10% | 35% | 11% | none | none | 3% | 3% | 10%) IntelASM_Expression: (IntelASM_HexNumber | IntelASM_Number | IntelASM_Literal | IntelASM_RegisterExpr | IntelASM_VariableExpr | IntelASM_Brackets | IntelASM_BytePtr | IntelASM_DwordPtr | IntelASM_Dollar | IntelASM_MultiplicativeExpression | IntelASM_AdditiveExpression)
562 all 17% all IntelASM_Instruction: IntelASM_RegularInstruction [IntelASM_Comment] IntelASM_EndOfLine
562 (17% | 6% | 9% | 3% | 7% | 3% | 5% | 49% | none | 1%) |   IntelASM_RegularInstruction: (IntelASM_CALL | IntelASM_CMP | IntelASM_DB | IntelASM_DQ | IntelASM_JMP | IntelASM_NoArgs | IntelASM_OneArg | IntelASM_TwoArgs | IntelASM_REPNE | IntelASM_SysCall)
116 all all IntelASM_Label: IntelASM_Label_Definition ':'
2 375.00 IntelASM_Program: IntelASM_Line*
863 (12% | 7% | 3% | 65% | 13%) |   IntelASM_Line: (IntelASM_EndOfLine | IntelASM_Comment | IntelASM_Directive | IntelASM_Instruction | IntelASM_Label)
394 all IntelASM_Register: ("EAX"|"EBX"|"ECX"|"EDX"|"ESI"|"EDI"|"EBP"|"ESP"|"RAX"|"RBX"|"RCX"|"RDX"|"R8"|"R9"|"R10"|"CS"|"DS"|"SS"|"ES"|"FS"|"GS"|"AH"|"AL"|"BH"|"BL"|"CH"|"CL"|"DH"|"DL"|"AX"|"BX"|"CX"|"DX"|"BP"|"SI"|"DI"|"SP"|"RDI"|"RSI")
277 (7% | 3% | 89% | 0%) IntelASM_Variable: (IntelASM_Brackets_Address | IntelASM_Brackets_Register | IntelASM_Register | IntelASM_Identifier_Reference)
20 all all all |   IntelASM_Brackets_Address: '[' IntelASM_Identifier_Reference ']'
9 all all all |   IntelASM_Brackets_Register: '[' IntelASM_Register ']'

Terminals = 11 (instances=1,596)
Tokens = 44 (instances=4,718)

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