All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.nbt.snbt.SNBTcc Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
//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 ;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy