Skip to content

zwd321081/BI-JSON-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reference

lexer

  1. https://github.com/antlr/grammars-v4/blob/master/javascript/JavaScriptLexer.g4
  2. https://github.com/vtrushin/json-to-ast/blob/master/lib/tokenize.js

grammar

  1. https://github.com/antlr/grammars-v4/blob/master/json/JSON.g4
grammar JSON;

json
    : value
    ;


value
    : STRING(|STRING)*
    | NUMBER
    | obj
    | 'true'
    | 'false'
    ;

obj 
    : "{" pair (,pair)* "}"
    ;

pair
    String: value

STRING
   : '"' (ESC | SAFECODEPOINT)* '"'
   ;

NUMBER
   : '-'? INT ('.' [0-9] +)? EXP?
   ;




About

custom bi JSON parser

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published