Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: assembly/delphi/txl/cangas/extracted
Source used for this grammar: Jorge L. Cangas, TXL Grammar for Borland Delphi 2006, asm.grammar
, December 2007
asm_stmtblock
, asm_stm
, asmlabel_colon
, asm_unlabeledstm_semi
, asmid
, asmlabel
, asm_expr
, asm_infix_expr
, asm_term
, asm_primary
, asmhex
, asm_unlabeledstm
, asm_opcode_prefix
, asm_opcode
, asm_directive
, asm_directive_arg
, asm_register
, segmt_overr
, asm_prefixop
, asm_infixop
, asm_postfixop
, procedure_body
, unlabeled_stm
), 0 root (—), 2 top (procedure_body
, unlabeled_stm
), 17 bottom (colon
, key
, NL
, SP
, sign
2, asmlbl
, id
3, end_struct
, SPOFF
3, integernumber
, label_id
, space
, stringlit
, charlit
2, SPON
3, anynumber
3, number
).asm_stmtblock ::= "asm" asm_stm end_struct
asm_stm ::= asmlabel_colonasm_unlabeledstm_semi
asmlabel_colon ::= asmlabel colon
asm_unlabeledstm_semi ::= asm_unlabeledstm ";" NL
asmid ::= "@" asmlbl "@+" id "@+" anynumber "@+" key
asmlabel ::=
SPOFF asmid
SPON
label_idasm_expr ::=
asm_term asm_infix_expr
asm_infix_expr ::= asm_infixop asm_term
asm_term ::= asm_prefixopasm_primary asm_postfixop
asm_primary ::= "[" asm_expr "]" "(" asm_expr ")" asm_register id anynumber charlit stringlit asmhex SP asmlabel
asmhex ::= number SPOFF id SPON
asm_unlabeledstm ::= asm_directive "," asm_opcode_prefix asm_opcode asm_expr ","asm_directive_arg
asm_opcode_prefix ::= "lock" space
asm_opcode ::= "adc" "add" "and" "bswap" "bt" "btr" "bts" "call" "cdq" "cld" "cmp" "dec" "div" "f2xm1" "fabs" "fadd" "faddp" "fbstp" "fchs" "fclex" "fcom" "fcomp" "fcos" "fdiv" "fdivp" "fdivrp" "ffree" "fiadd" "fidiv" "fild" "fimul" "fistp" "fld" "fld1" "fldcw" "fldl2e" "fldlg2" "fldln2" "fldz" "fmul" "fmulp" "fnclex" "fninit" "fnstcw" "fnstsw" "fpatan" "fprem" "fptan" "frndint" "fscale" "fsin" "fsincos" "fsqrt" "fstcw" "fstp" "fstsw" "fsub" "fsubp" "fsubr" "fwait" "fxch" "fxtract" "fyl2x" "fyl2xp1" "imul" "inc" "int" "ja" "jae" "jb" "jbe" "jc" "je" "jecxz" "jg" "jge" "jl" "jle" "jmp" "jnc" "jne" "jnl" "jns" "jnz" "jo" "jp" "js" "jz" "lea" "leave" "lodsb" "lodsw" "loop" "mov" "movsb" "movsx" "movzx" "mul" "neg" "not" "or" "pop" "popfd" "push" "pushfd" "rcl" "rcr" "rep" "repe" "repne" "ret" "rol" "ror" "sahf" "sar" "sbb" "seto" "shl" "shld" "shr" "shrd" "std" "stosb" "stosd" "stosw" "sub" "test" "wait" "xadd" "xchg" "xor"
asm_directive ::= "DB" "DW" "DD" "DQ"
asm_directive_arg ::=
charlit
sign
anynumber
asm_exprasm_register ::= "ST" "(" integernumber ")" "ST" "FS" "GS" "EAX" "EBX" "ECX" "EDX" "ESP" "EBP" "ESI" "EDI" "AX" "BX" "CX" "DX" "SP" "BP" "SI" "DI" "AL" "BL" "CL" "DL" "CS" "DS" "SS" "ES" "AH" "BH" "CH" "DH" "CS" segmt_overr "DS" segmt_overr "SS" segmt_overr "FS" segmt_overr "GS" segmt_overr "ES" segmt_overr
segmt_overr ::=
SPOFF ":" asm_expr SPON
asm_prefixop ::= "high" "low" "offset" "dmtindex" "vmtoffset" "type" "not" "&" sign "@"
asm_infixop ::= "." "+" "-" "*" "/" "ptr" "mod" "xor" "and" "or" "shr" "shl"
asm_postfixop ::= "[" asm_expr "]" "." asm_expr
procedure_body ::= asm_stmtblock
unlabeled_stm ::= asm_stmtblock