xml: prolog element Comment
prolog: XMLDDecl? Comment (doctypedecl Comment)?
element: EmptyElementTag | stag content etag
Comment: ''Char_: qualquer caracter exceto '-'
XMLDecl: <'?'xml VersionInfo EncodingDecl? SDDecl? '?'>
doctypedecl: <'!'DOCTYPE Name ExternalID? ('[' intSubset ']')? >
EmptyElementTag: '<' Name Attribute* '/>'
stag: '<' Name Attribute* '>'
content: CharData? ((element | Reference | CDSect | Comment) CharData?)*
VersionInfo: 'version''='("'" VersionNum "'" | '"' VersionNum '"')
EncodingDecl: 'encoding''='('"' EncName '"' | "'" EncName "'" )
SDDecl: 'standalone''='(("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
ExternalID: 'SYSTEM' SystemLiteral | 'PUBLIC' PubidLiteral SystemLiteral
intSubset: (markupdecl | DeclSep)*
Attribute: Name '=' AttValue
Reference: EntityRef | CharRef
markupdecl: elementdecl | AttlistDecl | EntityDecl | NotationDecl | Comment
DeclSep: PEReference | ['WFC: PE Between Declarations']
EntityRef: '&' Name ';'
elementdecl: ''
AttlistDecl: ''
EntityDecl: GEDecl | PEDecl
NotationDecl: ''
PEReference: '%' Name ';'
contentspec: 'EMPTY' | 'ANY' | Mixed | children
AttDef: Name AttType DefaultDecl
GEDecl: ''
PEDecl: ''
Mixed: '(' '#PCDATA' Name* ')*' | '(' '#PCDATA' ')'
children: (choice | seq) ('?' | '*' | '+')?
AttType: 'CDATA' | 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS' | 'NOTATION' '(' Name* ')' | '(' Nmtoken* ')'
DefaultDecl: '#REQUIRED' | '#IMPLIED' | ('#FIXED'? AttValue)
EntityDef: EntityValue | ExternalID ('NDATA' Name)?
PEDef: EntityValue | ExternalID
choice: '(' cp+ ')'
seq: '(' cp ( ',' cp )* ')'
EntityValue: '"' ([^%&"] | PEReference | Reference)* '"'
cp: (Name | choice | seq) ('?' | '*' | '+')?
extSubset: TextDecl? extSubsetDecl
TextDecl: ''
extSubsetDecl: ( markupdecl | conditionalSect | DeclSep)*
conditionalSect: '' | ''
ignoreSectContents: Ignore ('' Ignore)*
Ignore: Char* '-' (Char* ('') Char*)
extParsedEnt: TextDecl? content
symbol: expression
CharRef: '' ['0-9']+ ';' | ' x' ['0-9a-fA-F']+ ';'
VersionNum: '1.' ['0-9']+
EncName: ['A-Za-z'] (['A-Za-z0-9._'] | '-')*