pykiss

Python Kisekae set viewer
git clone https://code.literati.org/pykiss.git
Log | Files | Refs | LICENSE

grammar.g (807B)


      1 parser KiSSParser:
      2     separator spaces: '\s+' ;
      3     token num: '\d' int ;
      4     token obj: '#\d+' ;
      5     token filename: '\S+' ;
      6     token name: '\w+' ;
      7     token var: '\w+' ;
      8     token string: '"[^"]*"' ; 
      9     token int: '-?\d+' int ;
     10     
     11     Field -> '\(' int ',' int '\)' ;
     12     Memsize -> '=' int 'K' ;
     13     Palettefile -> '%' filename ;
     14     Bordercol -> '\[' int ;
     15     Cel -> '#' int ( '.' int )? filename ( '\*' int)? ( ':' num? )? ;
     16     Setinfo -> '$' num Pos+ ;
     17     Pos -> int ',' int | '*' ;
     18 
     19     KissLine -> Field | Memsize | Palettefile | Bordercol | Cel | Setinfo ;
     20 
     21     EventHandler -> ';@EventHandler' ;
     22     Event -> name '\(' ArgList? '\)' ;
     23     Arg -> int | obj | var | string ;
     24     ArgList -> Arg ( ',' Arg )* ;
     25     FKiss -> ';@' Event* ;
     26     
     27     START -> KissLine+ ( EventHandler FKiss* ) ;