마이크로 소프트 매크로 어셈블러 BNF 문법Microsoft Macro Assembler BNF Grammar

이 페이지에는 MASM 문법에 대한 BNF 설명이 포함되어 있습니다.This page contains a BNF description of the MASM grammar. 그것은 참조에 대 한 보충으로 제공 하 고 완전 한 보장 되지 않습니다.It's provided as a supplement to the reference and isn't guaranteed to be complete. 키워드, 매개 변수, 작업 등자세한 내용은 참조를 참조하십시오.Consult the reference for full information on keywords, parameters, operations, and so on.

BNF의 사용을 설명하기 위해 다음 다이어그램은 비터미널로 typedefDir 시작하는 TYPEDEF 지시문 정의를 보여 줍니다.To illustrate the use of the BNF, the following diagram shows the definition of the TYPEDEF directive, starting with the nonterminal typedefDir.

MASM BNF 예제

각 가로 보조기 아래에 있는 항목은 NEAR16 NEAR32". FAR16 FAR32 및 및 .The entries under each horizontal brace are terminals, such as NEAR16, NEAR32, FAR16, and FAR32. 또는 qualifier" qualifiedType distance 및 이와 같은 비터미널이며 protoSpec 추가정의할 수 있습니다.Or, they're nonterminals such as qualifier, qualifiedType, distance, and protoSpec that can be further defined. typedefDir 정의에서 각 기울임꼴 비터미널는 BNF의 항목이기도 합니다.Each italicized nonterminal in the typedefDir definition is also an entry in the BNF. 세 개의 세로 점은 단순성을 위해 이 그림이 설명하지 않는 비터미널에 대한 분기 정의를 나타냅니다.Three vertical dots indicate a branching definition for a nonterminal that, for the sake of simplicity, this figure doesn't illustrate.

BNF 문법은 재귀 정의를 허용합니다.The BNF grammar allows recursive definitions. 예를 들어 문법은 qualifiedType에 대한 가능한 정의로 qualifiedType을 사용하며, 이는 한정자에 대한 정의의 구성 요소이기도 합니다.For example, the grammar uses qualifiedType as a possible definition for qualifiedType, which is also a component of the definition for qualifier. "|" 기호는 대체 식 중에서 선택할 수 endOfLine | comment 있는 예:The "|" symbol specifies a choice between alternate expressions, for example endOfLine | comment. 이중 중괄호는 선택적 매개 macroParmList 변수(예:Double braces specify an optional parameter, for example ⟦ macroParmList ⟧. 대괄호는 실제로 소스 코드에 나타나지 않습니다.The brackets don't actually appear in the source code.

MASM 비터미널MASM Nonterminals

;;
    endOfLine | comment

=Dir
    id = immExpr ;;    id = immExpr ;;

addOp
    + | -

aExpr
    term | aExpr && term    term | aExpr && term

altId
    id

arbitraryText
    charList

asmInstruction
    mnemonicexprList    mnemonicexprList

assumeDir
    ASSUME assumeList ;;    ASSUME assumeList ;;
    | ASSUME NOTHING ;;    | ASSUME NOTHING ;;

assumeList
    assumeRegister | assumeList , assumeRegister    assumeRegister | assumeList , assumeRegister\

assumeReg
    register : assumeVal    register : assumeVal

assumeRegister
    assumeSegReg | assumeReg

assumeSegReg
    segmentRegister : assumeSegVal    segmentRegister : assumeSegVal

assumeSegVal
    frameExpr | NOTHING | ERROR

assumeVal
    qualifiedType | NOTHING | ERROR

bcdConst
    ⟦ signdecNumber    ⟦ signdecNumber

binaryOp
    == | != | >= | <= | > | < | &

bitDef
    bitFieldId : bitFieldSize= constExpr    bitFieldId : bitFieldSize= constExpr

bitDefList
    bitDef | bitDefList ,;;bitDef    bitDef | bitDefList ,;;bitDef

bitFieldId
    id

bitFieldSize
    constExpr

blockStatements
    directiveList
    | .CONTINUE .IF cExpr    | .CONTINUE .IF cExpr
    | .BREAK.IF cExpr    | .BREAK.IF cExpr

bool
    TRUE | FALSE

byteRegister
    AL | AH | CL | CH | DL | DH | BL | BH | R8B | R9B | R10B | R11B | R12B | R13B | R14B | R15B

cExpr
    aExpr | cExpr || aExpr    aExpr | cExpr || aExpr

character
    줄 바수(10)를 제외한 범위 0-255에 서수인 모든 문자입니다.    Any character with ordinal in the range 0–255 except linefeed (10).

charList
    character | charList character    character | charList character

className
    string

commDecl
    ⟦ nearfar ⟧ ⟦ langTypeid : commType    ⟦ nearfar ⟧ ⟦ langTypeid : commType
    ⟦ : constExpr    ⟦ : constExpr

commDir
    COMM
    commList ;;    commList ;;

comment
    ; text ;;    ; text ;;

commentDir
    COMMENT delimiter    COMMENT delimiter
    text
    text delimiter text ;;    text delimiter text ;;

commList
    commDecl | commList , commDecl    commDecl | commList , commDecl

commType
    type | constExpr

constant
    digitsradixOverride    digitsradixOverride

constExpr
    expr

contextDir
    PUSHCONTEXT contextItemList ;;    PUSHCONTEXT contextItemList ;;
    POPCONTEXT contextItemList ;;    POPCONTEXT contextItemList ;;

contextItem
    ASSUMES | RADIX | LISTING | CPU | ALL

contextItemList
    contextItem | contextItemList , contextItem    contextItem | contextItemList , contextItem

controlBlock
    whileBlock | repeatBlock

controlDir
    controlIf | controlBlock

controlElseif
    .ELSEIF     cExpr ;;    .ELSEIF     cExpr ;;
    directiveList
    ⟦ controlElseif    ⟦ controlElseif

controlIf
    .IF     cExpr ;;    .IF     cExpr ;;
    directiveList
    ⟦ controlElseif    ⟦ controlElseif
    ⟦ .ELSE ;;    ⟦ .ELSE ;;
    [directiveList    [directiveList
    .ENDIF ;;    .ENDIF ;;

coprocessor
    .8087 | .287 | .387 | .NO87

crefDir
    crefOption ;;    crefOption ;;

crefOption
    .CREF
    | .XCREFidList    | .XCREFidList
    | .NOCREFidList    | .NOCREFidList

cxzExpr
    expr
    | ! expr    | ! expr
    | expr == expr    | expr == expr
    | expr != expr    | expr != expr

dataDecl
    DB | DW | DD | DF | DQ | DT | dataType | typeId

dataDir
    ⟦ iddataItem ;;    ⟦ iddataItem ;;

dataItem
    dataDecl scalarInstList    dataDecl scalarInstList
    | structTag structInstList    | structTag structInstList
    | typeId structInstList    | typeId structInstList
    | unionTag structInstList    | unionTag structInstList
    | recordTag recordInstList    | recordTag recordInstList

dataType
    BYTE | SBYTE | WORD | SWORD | DWORD | SDWORD | FWORD | QWORD | SQWORD | TBYTE | OWORD | REAL4 | REAL8 | REAL10 | MMWORD | XMMWORD | YMMWORD

decdigit
    0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

decNumber
    decdigit
    | decNumber decdigit    | decNumber decdigit

delimiter
    제외한 모든 문자*whiteSpaceCharacter*    Any character except whiteSpaceCharacter

digits
    decdigit
    | digits decdigit    | digits decdigit
    | digits hexdigit    | digits hexdigit

directive
    generalDir | segmentDef

directiveList
    directive | directiveList directive    directive | directiveList directive

distance
    nearfar | NEAR16 | NEAR32 | FAR16 | FAR32

e01
    e01 orOp e02 | e02    e01 orOp e02 | e02

e02
    e02 AND e03 | e03    e02 AND e03 | e03

e03
    NOT e04 | e04    NOT e04 | e04

e04
    e04 relOp e05 | e05    e04 relOp e05 | e05

e05
    e05 addOp e06 | e06    e05 addOp e06 | e06

e06
    e06 mulOp e07 | e06 shiftOp e07 | e07    e06 mulOp e07 | e06 shiftOp e07 | e07

e07
    e07 addOp e08 | e08    e07 addOp e08 | e08

e08
    HIGH e09    HIGH e09
    | LOW e09    | LOW e09
    | HIGHWORD e09    | HIGHWORD e09
    | LOWWORD e09    | LOWWORD e09
    | e09

e09
    OFFSET e10    OFFSET e10
    | SEG e10    | SEG e10
    | LROFFSET e10    | LROFFSET e10
    | TYPE e10    | TYPE e10
    | THIS e10    | THIS e10
    | e09 PTR e10    | e09 PTR e10
    | e09 : e10    | e09 : e10
    | e10

e10
    e10 . e11    e10 . e11
    | e10expr    | e10expr
    | e11

e11
    ( expr )    ( expr )
    | ⟦ expr    | ⟦ expr
    | WIDTH id    | WIDTH id
    | MASK id    | MASK id
    | SIZE sizeArg    | SIZE sizeArg
    | SIZEOF sizeArg    | SIZEOF sizeArg
    | LENGTH id    | LENGTH id
    | LENGTHOF id    | LENGTHOF id
    | recordConst
    | string
    | constant
    | type
    | id
    | $
    | segmentRegister
    | register
    | ST
    | ST ( expr )    | ST ( expr )

echoDir
    ECHO
    arbitraryText ;;    arbitraryText ;;
    %OUT arbitraryText ;;    %OUT arbitraryText ;;

elseifBlock
    elseifStatement ;;    elseifStatement ;;
    directiveList
    ⟦ elseifBlock    ⟦ elseifBlock

elseifStatement
    ELSEIF constExpr    ELSEIF constExpr
    | ELSEIFE constExpr    | ELSEIFE constExpr
    | ELSEIFB textItem    | ELSEIFB textItem
    | ELSEIFNB textItem    | ELSEIFNB textItem
    | ELSEIFDEF id    | ELSEIFDEF id
    | ELSEIFNDEF id    | ELSEIFNDEF id
    | ELSEIFDIF textItem , textItem    | ELSEIFDIF textItem , textItem
    | ELSEIFDIFI textItem , textItem    | ELSEIFDIFI textItem , textItem
    | ELSEIFIDN textItem , textItem    | ELSEIFIDN textItem , textItem
    | ELSEIFIDNI textItem , textItem    | ELSEIFIDNI textItem , textItem
    | ELSEIF1
    | ELSEIF2

endDir
    ENDimmExpr;;    ENDimmExpr;;

endpDir
    procId ENDP ;;    procId ENDP ;;

endsDir
    id ENDS ;;    id ENDS ;;

equDir
    textMacroId EQU equType ;;    textMacroId EQU equType ;;

equType
    immExpr | textLiteral

errorDir
    errorOpt ;;    errorOpt ;;

errorOpt
    .ERRtextItem    .ERRtextItem
    | .ERRE constExproptText    | .ERRE constExproptText
    | .ERRNZ constExproptText    | .ERRNZ constExproptText
    | .ERRB textItemoptText    | .ERRB textItemoptText
    | .ERRNB textItemoptText    | .ERRNB textItemoptText
    | .ERRDEF idoptText    | .ERRDEF idoptText
    | .ERRNDEF idoptText    | .ERRNDEF idoptText
    | .ERRDIF textItem , textItemoptText    | .ERRDIF textItem , textItemoptText
    | .ERRDIFI textItem , textItemoptText    | .ERRDIFI textItem , textItemoptText
    | .ERRIDN textItem , textItemoptText    | .ERRIDN textItem , textItemoptText
    | .ERRIDNI textItem , textItemoptText    | .ERRIDNI textItem , textItemoptText
    | .ERR1textItem    | .ERR1textItem
    | .ERR2textItem    | .ERR2textItem

exitDir
    .EXIT     ⟦ expr;;    .EXIT     ⟦ expr;;

exitmDir
    : EXITM | EXITM textItem    : EXITM | EXITM textItem

exponent
    EsigndecNumber    EsigndecNumber

expr
    SHORT e05    SHORT e05
    | .TYPE e01    | .TYPE e01
    | OPATTR e01    | OPATTR e01
    | e01

exprList
    expr | exprList , expr    expr | exprList , expr

externDef
    ⟦ langTypeid( altId ): externType    ⟦ langTypeid( altId ): externType

externDir
    externKey externList ;;    externKey externList ;;

externKey
    EXTRN | EXTERN | EXTERNDEF

externList
    externDef | externList ,;;externDef    externDef | externList ,;;externDef

externType
    ABS | qualifiedType

fieldAlign
    constExpr

fieldInit
    ⟦ initValue ⟧ | structInstance    ⟦ initValue ⟧ | structInstance

fieldInitList
    fieldInit | fieldInitList ,;;fieldInit    fieldInit | fieldInitList ,;;fieldInit

fileChar
    delimiter

fileCharList
    fileChar | fileCharList fileChar    fileChar | fileCharList fileChar

fileSpec
    fileCharList | textLiteral

flagName
    ZERO? | CARRY? | OVERFLOW? | SIGN? | PARITY?

floatNumber
    ⟦ signdecNumber .decNumber ⟧ ⟦ exponent    ⟦ signdecNumber .decNumber ⟧ ⟦ exponent
    | digits R | digits r    | digits R | digits r

forcDir
    FORC | IRPC

forDir
    FOR | IRP

forParm
    id: forParmType    id: forParmType

forParmType
    REQ | = textLiteral    REQ | = textLiteral

fpuRegister
    ST expr    ST expr

frameExpr
    SEG id    SEG id
    | DGROUP : id    | DGROUP : id
    | segmentRegister : id    | segmentRegister : id
    | id

generalDir
    modelDir | segOrderDir | nameDir
    | includeLibDir | commentDir
    | groupDir | assumeDir
    | structDir | recordDir | typedefDir
    | externDir | publicDir | commDir | protoTypeDir
    | equDir | =Dir | textDir
    | contextDir | optionDir | processorDir
    | radixDir
    | titleDir | pageDir | listDir
    | crefDir | echoDir
    | ifDir | errorDir | includeDir
    | macroDir | macroCall | macroRepeat | purgeDir
    | macroWhile | macroFor | macroForc
    | aliasDir

gpRegister
    AX | EAX | CX | ECX | DX | EDX | BX | EBX | DI | EDI | SI | ESI | BP | EBP | SP | ESP | RSP | R8W | R8D | R9W | R9D | R12D | R13W | R13D | R14W | R14D

groupDir
    groupId GROUP segIdList    groupId GROUP segIdList

groupId
    id

hexdigit
    a | b | c | d | e | f | A | B | C | D | E | F

id
    식별자의 첫 번째 문자는 대문자 또는 소문자 알파벳[A–Za-z]문자() 또는 이 @ _ $ ? 네 문자 중 어느 한 쪽이 될[0–9]수 있습니다.    The first character of the identifier can be an upper or lower-case alphabetic character ([A–Za-z]) or any of these four characters: @ _ $ ? The remaining characters can be any of those same characters or a decimal digit ([0–9]). 최대 길이는 247자입니다.Maximum length is 247 characters.

idList
    id | idList , id    id | idList , id

ifDir
    ifStatement ;;    ifStatement ;;
    directiveList
    ⟦ elseifBlock    ⟦ elseifBlock
    ⟦ ELSE ;;     ⟦ ELSE ;;
    directiveList;;    directiveList;;

ifStatement
    IF constExpr    IF constExpr
    | IFE constExpr    | IFE constExpr
    | IFB textItem    | IFB textItem
    | IFNB textItem    | IFNB textItem
    | IFDEF id    | IFDEF id
    | IFNDEF id    | IFNDEF id
    | IFDIF textItem , textItem    | IFDIF textItem , textItem
    | IFDIFI textItem , textItem    | IFDIFI textItem , textItem
    | IFIDN textItem , textItem    | IFIDN textItem , textItem
    | IFIDNI textItem , textItem    | IFIDNI textItem , textItem
    | IF1
    | IF2

immExpr
    expr

includeDir
    INCLUDE fileSpec ;;    INCLUDE fileSpec ;;

includeLibDir
    INCLUDELIB fileSpec ;;    INCLUDELIB fileSpec ;;

initValue
    immExpr
    | string
    | ?
    | constExpr DUP ( scalarInstList )    | constExpr DUP ( scalarInstList )
    | floatNumber
    | bcdConst

inSegDir
    ⟦ labelDefinSegmentDir    ⟦ labelDefinSegmentDir

inSegDirList
    inSegDir | inSegDirList inSegDir    inSegDir | inSegDirList inSegDir

inSegmentDir
    instruction
    | dataDir
    | controlDir
    | startupDir
    | exitDir
    | offsetDir
    | labelDir
    | procDirlocalDirList ⟧ ⟦ inSegDirListendpDir    | procDirlocalDirList ⟧ ⟦ inSegDirListendpDir
    | invokeDir
    | generalDir

instrPrefix
    REP | REPE | REPZ | REPNE | REPNZ | LOCK

instruction
    ⟦ instrPrefixasmInstruction    ⟦ instrPrefixasmInstruction

invokeArg
    register :: register | expr | ADDR expr    register :: register | expr | ADDR expr

invokeDir
    INVOKE expr,;;invokeList;;    INVOKE expr,;;invokeList;;

invokeList
    invokeArg | invokeList ,;;invokeArg    invokeArg | invokeList ,;;invokeArg

keyword
    예약된 단어입니다.    Any reserved word.

keywordList
    keyword | keyword keywordList    keyword | keyword keywordList

labelDef
    id : | id :: | @@:    id : | id :: | @@:

labelDir
    id LABEL qualifiedType ;;    id LABEL qualifiedType ;;

langType
    C | PASCAL | FORTRAN | BASIC | SYSCALL | STDCALL

listDir
    listOption ;;    listOption ;;

listOption
    .LIST
    | .NOLIST
    | .XLIST
    | .LISTALL
    | .LISTIF
    | .LFCOND
    | .NOLISTIF
    | .SFCOND
    | .TFCOND
    | .LISTMACROALL | .LALL
    | .NOLISTMACRO | .SALL
    | .LISTMACRO | .XALL

localDef
    LOCAL idList ;;    LOCAL idList ;;

localDir
    LOCAL parmList ;;    LOCAL parmList ;;

localDirList
    localDir | localDirList localDir    localDir | localDirList localDir

localList
    localDef | localList localDef    localDef | localList localDef

macroArg
    % constExpr    % constExpr
    | % textMacroId    | % textMacroId
    | % macroFuncId ( macroArgList )    | % macroFuncId ( macroArgList )
    | string
    | arbitraryText
    | < arbitraryText >    | < arbitraryText >

macroArgList
    macroArg | macroArgList , macroArg    macroArg | macroArgList , macroArg

macroBody
    ⟦ localListmacroStmtList    ⟦ localListmacroStmtList

macroCall
    id macroArgList ;;    id macroArgList ;;
    | id ( macroArgList )    | id ( macroArgList )

macroDir
    id MACROmacroParmList;;    id MACROmacroParmList;;
    macroBody
    ENDM ;;    ENDM ;;

macroFor
    forDir forParm , < macroArgList > ;;    forDir forParm , < macroArgList > ;;
    macroBody
    ENDM ;;    ENDM ;;

macroForc
    forcDir id , textLiteral ;;    forcDir id , textLiteral ;;
    macroBody
    ENDM ;;    ENDM ;;

macroFuncId
    id

macroId
    macroProcId | macroFuncId

macroIdList
    macroId | macroIdList , macroId    macroId | macroIdList , macroId

macroLabel
    id

macroParm
    id: parmType    id: parmType

macroParmList
    macroParm | macroParmList ,;;macroParm    macroParm | macroParmList ,;;macroParm

macroProcId
    id

macroRepeat
    repeatDir constExpr ;;    repeatDir constExpr ;;
    macroBody
    ENDM ;;    ENDM ;;

macroStmt
    directive
    | exitmDir
    | : macroLabel    | : macroLabel
    | GOTO macroLabel    | GOTO macroLabel

macroStmtList
    macroStmt ;;    macroStmt ;;
    | macroStmtList macroStmt ;;    | macroStmtList macroStmt ;;\

macroWhile
    WHILE constExpr ;;    WHILE constExpr ;;
    macroBody
    ENDM ;;    ENDM ;;

mapType
    ALL | NONE | NOTPUBLIC

memOption
    TINY | SMALL | MEDIUM | COMPACT | LARGE | HUGE | FLAT

mnemonic
    명령 이름입니다.    Instruction name.

modelDir
    .MODEL
    memOption, modelOptlist;;    memOption, modelOptlist;;

modelOpt
    langType | stackOption

modelOptlist
    modelOpt | modelOptlist , modelOpt    modelOpt | modelOptlist , modelOpt

module
    ⟦ directiveListendDir    ⟦ directiveListendDir

mulOp
    * | / | MOD

nameDir
    NAME
    id ;;    id ;;

nearfar
    NEAR | FAR

nestedStruct
    structHdrid;;    structHdrid;;
    structBody
    ENDS ;;    ENDS ;;

offsetDir
    offsetDirType ;;    offsetDirType ;;

offsetDirType
    EVEN | ORG immExpr | ALIGNconstExpr    EVEN | ORG immExpr | ALIGNconstExpr

offsetType
    GROUP | SEGMENT | FLAT

oldRecordFieldList
    ⟦ constExpr ⟧ | oldRecordFieldList ,constExpr    ⟦ constExpr ⟧ | oldRecordFieldList ,constExpr

optionDir
    OPTION optionList ;;    OPTION optionList ;;

optionItem
    CASEMAP : mapType    CASEMAP : mapType
    | DOTNAME | NODOTNAME
    | EMULATOR | NOEMULATOR
    | EPILOGUE : macroId    | EPILOGUE : macroId
    | EXPR16 | EXPR32
    | LANGUAGE : langType    | LANGUAGE : langType
    | LJMP | NOLJMP
    | M510 | NOM510
    | NOKEYWORD : < keywordList >    | NOKEYWORD : < keywordList >
    | NOSIGNEXTEND
    | OFFSET : offsetType    | OFFSET : offsetType
    | OLDMACROS | NOOLDMACROS
    | OLDSTRUCTS | NOOLDSTRUCTS
    | PROC : oVisibility    | PROC : oVisibility
    | PROLOGUE : macroId    | PROLOGUE : macroId
    | READONLY | NOREADONLY
    | SCOPED | NOSCOPED
    | SEGMENT : segSize    | SEGMENT : segSize
    | SETIF2 : bool    | SETIF2 : bool

optionList
    optionItem | optionList ,;;optionItem    optionItem | optionList ,;;optionItem

optText
    , textItem    , textItem

orOp
    OR | XOR

oVisibility
    PUBLIC | PRIVATE | EXPORT

pageDir
    PAGEpageExpr;;    PAGEpageExpr;;

pageExpr
    + | ⟦ pageLength ⟧ ⟦ , pageWidth    + | ⟦ pageLength ⟧ ⟦ , pageWidth

pageLength
    constExpr

pageWidth
    constExpr

parm
    parmId: qualifiedType ⟧ | parmIdconstExpr ⟧ ⟦ : qualifiedType    parmId: qualifiedType ⟧ | parmIdconstExpr ⟧ ⟦ : qualifiedType

parmId
    id

parmList
    parm | parmList ,;;parm    parm | parmList ,;;parm

parmType
    REQ | = textLiteral | VARARG    REQ | = textLiteral | VARARG

pOptions
    ⟦ distance ⟧ ⟦ langType ⟧ ⟦ oVisibility    ⟦ distance ⟧ ⟦ langType ⟧ ⟦ oVisibility

primary
    expr binaryOp expr | flagName | expr    expr binaryOp expr | flagName | expr

procDir
    procId PROC    procId PROC
    ⟦ pOptions ⟧ ⟦ < macroArgList >    ⟦ pOptions ⟧ ⟦ < macroArgList >
    ⟦ usesRegs ⟧ ⟦ procParmList    ⟦ usesRegs ⟧ ⟦ procParmList

processor
    | .386 | .386p | .486 | .486P
    | .586 | .586P | .686 | .686P | .387

processorDir
    processor ;;    processor ;;
    | coprocessor ;;    | coprocessor ;;

procId
    id

procItem
    instrPrefix | dataDir | labelDir | offsetDir | generalDir

procParmList
    ⟦ ,;;parmList    ⟦ ,;;parmList
    ⟦ ,;;parmId :VARARG    ⟦ ,;;parmId :VARARG

protoArg
    ⟦ id: qualifiedType    ⟦ id: qualifiedType

protoArgList
    ⟦ ,;;protoList    ⟦ ,;;protoList
    ⟦ ,;; ⟧ ⟦ id:VARARG    ⟦ ,;; ⟧ ⟦ id:VARARG

protoList
    protoArg
    | protoList ,;;protoArg    | protoList ,;;protoArg

protoSpec
    ⟦ distance ⟧ ⟦ langType ⟧ ⟦ protoArgList ⟧ | typeId    ⟦ distance ⟧ ⟦ langType ⟧ ⟦ protoArgList ⟧ | typeId

protoTypeDir
    id PROTO protoSpec    id PROTO protoSpec

pubDef
    ⟦ langTypeid    ⟦ langTypeid

publicDir
    PUBLIC pubList ;;    PUBLIC pubList ;;

pubList
    pubDef | pubList ,;;pubDef    pubDef | pubList ,;;pubDef

purgeDir
    PURGE macroIdList    PURGE macroIdList

qualifiedType
    type | ⟦ distancePTRqualifiedType    type | ⟦ distancePTRqualifiedType

qualifier
    qualifiedType | PROTO protoSpec    qualifiedType | PROTO protoSpec

quote
    " | '

qwordRegister
    RAX | RCX | RDX | RBX | RDI | RSI | RBP | R8 | R9 | R10 | R11 | R12 | R13 | R14 | R15

radixDir
    .RADIX constExpr ;;    .RADIX constExpr ;;

radixOverride
    h | o | q | t | y | H | O | Q | T | Y

recordConst
    recordTag { oldRecordFieldList } | recordTag < oldRecordFieldList >    recordTag { oldRecordFieldList } | recordTag < oldRecordFieldList >

recordDir
    recordTag RECORD bitDefList ;;    recordTag RECORD bitDefList ;;

recordFieldList
    ⟦ constExpr ⟧ | recordFieldList ,;; ⟧ ⟦ constExpr    ⟦ constExpr ⟧ | recordFieldList ,;; ⟧ ⟦ constExpr

recordInstance
    {;;recordFieldList;;}    {;;recordFieldList;;}
    | < oldRecordFieldList >    | < oldRecordFieldList >
    | constExpr DUP ( recordInstance )    | constExpr DUP ( recordInstance )

recordInstList
    recordInstance | recordInstList ,;;recordInstance    recordInstance | recordInstList ,;;recordInstance

recordTag
    id

register
    specialRegister | gpRegister | byteRegister | qwordRegister | fpuRegister | SIMDRegister | segmentRegister

regList
    register | regList register    register | regList register

relOp
    EQ | NE | LT | LE | GT | GE

repeatBlock
    .REPEAT ;;    .REPEAT ;;
    blockStatements ;; untilDir ;;    blockStatements ;; untilDir ;;

repeatDir
    REPEAT | REPT

scalarInstList
    initValue | scalarInstList ,;;initValue    initValue | scalarInstList ,;;initValue

segAlign
    BYTE | WORD | DWORD | PARA | PAGE

segAttrib
    PUBLIC | STACK | COMMON | MEMORY | AT constExpr | PRIVATE    PUBLIC | STACK | COMMON | MEMORY | AT constExpr | PRIVATE

segDir
    .CODE
    ⟦ segId    ⟦ segId
    | .DATA
    | .DATA?
    | .CONST
    | .FARDATAsegId    | .FARDATAsegId
    | .FARDATA?segId    | .FARDATA?segId
    | .STACKconstExpr    | .STACKconstExpr

segId
    id

segIdList
    segId
    | segIdList , segId    | segIdList , segId

segmentDef
    segmentDirinSegDirListendsDir | simpleSegDirinSegDirList ⟧ ⟦ endsDir    segmentDirinSegDirListendsDir | simpleSegDirinSegDirList ⟧ ⟦ endsDir

segmentDir
    segId SEGMENTsegOptionList;;    segId SEGMENTsegOptionList;;

segmentRegister
    CS | DS | ES | FS | GS | SS

segOption
    segAlign
    | segRO
    | segAttrib
    | segSize
    | className

segOptionList
    segOption | segOptionList segOption    segOption | segOptionList segOption

segOrderDir
    .ALPHA | .SEQ | .DOSSEG | DOSSEG

segRO
    READONLY

segSize
    USE16 | USE32 | FLAT

shiftOp
    SHR | SHL

sign
    + | -

simdRegister
    MM0 | MM1 | MM2 | MM3 | MM4 | MM5 | MM6 | MM7
    | xmmRegister
    | YMM0 | YMM1 | YMM2 | YMM3 | YMM4 | YMM5 | YMM6 | YMM7 | YMM8 | YMM9 | YMM10 | YMM11 | YMM12 | YMM13 | YMM14 | YMM15

simpleExpr
    ( cExpr ) | primary    ( cExpr ) | primary

simpleSegDir
    segDir ;;    segDir ;;

sizeArg
    id | type | e10

specialChars
    : | . | [ | ] | ( | ) | < | > | { | }
    | + | - | / | * | & | % | !
    | ' | \ | = | ; | , | "
    | whiteSpaceCharacter
    | endOfLine

specialRegister
    CR0 | CR2 | CR3 | DR0 | DR1 | DR2 | DR3 | DR6 | DR7 | TR3 | TR4 | TR5 | TR6 | TR7

stackOption
    NEARSTACK | FARSTACK

startupDir
    .STARTUP ;;    .STARTUP ;;

stext
    stringChar | stext stringChar    stringChar | stext stringChar

string
    quotestextquote    quotestextquote

stringChar
    quote**quote | 따옴표를 제외한 모든 문자입니다.    quote quote | Any character except quote.

structBody
    structItem ;;    structItem ;;
    | structBody structItem ;;    | structBody structItem ;;

structDir
    structTag structHdrfieldAlign    structTag structHdrfieldAlign
    ⟦ , NONUNIQUE;;    ⟦ , NONUNIQUE;;
    structBody
    structTag
    ENDS ;;    ENDS ;;

structHdr
    STRUC | STRUCT | UNION

structInstance
    <fieldInitList>    <fieldInitList>
    | {;; ⟧ ⟦ fieldInitList ⟧ ⟦ ;;}    | {;; ⟧ ⟦ fieldInitList ⟧ ⟦ ;;}
    | constExpr DUP ( structInstList )    | constExpr DUP ( structInstList )

structInstList
    structInstance | structInstList ,;;structInstance    structInstance | structInstList ,;;structInstance

structItem
    dataDir
    | generalDir
    | offsetDir
    | nestedStruct

structTag
    id

term
    simpleExpr | ! simpleExpr    simpleExpr | ! simpleExpr

text
    textLiteral | text 문자 | ! character text | character | *!***character    textLiteral | text character | ! character text | character | ! character

textDir
    id textMacroDir ;;    id textMacroDir ;;

textItem
    textLiteral | textMacroId | % constExpr    textLiteral | textMacroId | % constExpr

textLen
    constExpr

textList
    textItem | textList ,;;textItem    textItem | textList ,;;textItem

textLiteral
    < text > ;;    < text > ;;

textMacroDir
    CATSTRtextList    CATSTRtextList
    | TEXTEQUtextList    | TEXTEQUtextList
    | SIZESTR textItem    | SIZESTR textItem
    | SUBSTR textItem , textStart, textLen    | SUBSTR textItem , textStart, textLen
    | INSTRtextStart ,textItem , textItem    | INSTRtextStart ,textItem , textItem

textMacroId
    id

textStart
    constExpr

titleDir
    titleType arbitraryText ;;    titleType arbitraryText ;;

titleType
    TITLE | SUBTITLE | SUBTTL

type
    structTag
    | unionTag
    | recordTag
    | distance
    | dataType
    | typeId

typedefDir
    typeId***TYPEDEF* 한정자    typeId TYPEDEF qualifier

typeId
    id

unionTag
    id

untilDir
    .UNTIL cExpr ;;    .UNTIL cExpr ;;
    .UNTILCXZcxzExpr;;    .UNTILCXZcxzExpr;;

usesRegs
    USES regList    USES regList

whileBlock
    .WHILE
    cExpr ;;    cExpr ;;
    blockStatements ;;    blockStatements ;;
    .ENDW

whiteSpaceCharacter
    ASCII 8, 9, 11-13, 26, 32    ASCII 8, 9, 11–13, 26, 32

xmmRegister
    XMM0 | XMM1 | XMM2 | XMM3 | XMM4 | XMM5 | XMM6 | XMM7 | XMM8 | XMM9 | XMM10 | XMM11 | XMM12 | XMM13 | XMM14 | XMM15