cn.nukkit.nbt.snbt.SNBTcc Maven / Gradle / Ivy
//Powered by javacc21 https://github.com/javacc21/javacc21
PARSER_PACKAGE="cn.nukkit.nbt.snbt";
NODE_PACKAGE="cn.nukkit.nbt.snbt.ast";
DEFAULT_LEXICAL_STATE=SNBT;
LEGACY_GLITCHY_LOOKAHEAD=false;
PARSER_BEGIN(SNBTParserImplement)
PARSER_END(SNBTParserImplement)
SKIP : ;
// Delimiters
TOKEN #Delimiter :
|
|
|
|
|
;
// Literals
TOKEN #Literal :
<#ZERO : "0">
|
<#NON_ZERO : (['1'-'9'])(["0"-"9"])*>
|
<#FRACTION : "." (["0"-"9"])+>
|
<#EXPONENT : ["E","e"](["+","-"])?(["1"-"9"])+>
|
|
|)()?()? ('f'|'F')>
|
|)()?()? ('d'|'D')>
|
|)>
|
('l'|'L')>
|
('b'|'B')>
|
('s'|'S')>
|
;
//Special Node
Value :
|
|
|
|
|
|
|
|
ByteArrayNBT
|
IntArrayNBT
|
CompoundNBT
|
ListNBT
;
KeyValuePair : (Value)?;
ByteArrayNBT :
"B" ";"=>|| ( ( | ) ( ( | ))* ()?)?
;
IntArrayNBT :
"I" ";"=>|| ( ( )* ()?)?
;
ListNBT :
(Value ( Value)*)?
;
CompoundNBT : (KeyValuePair ( KeyValuePair)*)? ;
//Root Node
Root : Value ;