goantlr

https://mikespook.com/2014/05/%e7%bf%bb%e8%af%91%e7%bc%96%e8%af%91%e5%99%a88-%e6%8a%bd%e8%b1%a1%e8%af%ad%e6%b3%95%e6%a0%91/



https://www.jianshu.com/p/6bf0b5cb738b



https://github.com/jamiebuilds/the-super-tiny-compiler



https://wenku.baidu.com/view/ea118454f56527d3240c844769eae009591ba24e.html



https://www.jianshu.com/p/0cf054a8365f



http://c.biancheng.net/view/765.html



This project uses goyacc and ragel tools to create PHP parser. It parses source code into AST. It can be used to write static analysis, refactoring, metrics, code style formatting tools.
https://github.com/z7zmey/php-parser
https://github.com/antlr/antlr4
https://github.com/nikic/PHP-Parser
This is a PHP 5.2 to PHP 7.4 parser written in PHP. Its purpose is to simplify static code analysis and manipulation.



Documentation for version 4.x (stable; for running on PHP >= 7.0; for parsing PHP 5.2 to PHP 7.4).



Documentation for version 3.x (unsupported; for running on PHP >= 5.5; for parsing PHP 5.2 to PHP 7.2).




https://stackoverflow.com/questions/20261519/thrift-converting-from-simple-json



https://tech.liuchao.me/2019/05/parse-thrift-in-go-the-antlr-way/



https://github.com/antlr/grammars-v4/blob/master/thrift/Thrift.g4



https://blog.gopheracademy.com/advent-2017/parsing-with-antlr4-and-go/



https://www.cnblogs.com/solvit/p/10161987.html



https://blog.csdn.net/haifeng_gu/article/details/74231349



https://github.com/antlr/antlr4



https://github.com/antlr/antlr4/blob/master/doc/index.md



https://pragprog.com/titles/tpantlr2/



https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=67640751



https://www.omnidex.com/
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=67635497
http://www.engr.mun.ca/~theo/JavaCC-FAQ/javacc-faq-moz.htm
http://aandds.com/blog/javacc.html



1 JavaCC简介
JavaCC (Java Compiler Compiler) is an open source parser generator and lexical analyzer generator written in the Java programming language. JavaCC is similar to yacc in that it generates a parser from a formal grammar written in EBNF notation. Unlike yacc, however, JavaCC generates top-down parsers.
参考:https://javacc.java.net/
注:学习JavaCC最快的方法是做一遍它自带的examples
1.1 JavaCC的features
TOP-DOWN:JavaCC产生自顶向下的语法分析器,而YACC等工具则产生的是自底向上的语法分析器。采用自顶向下的分析方法允许更通用的语法(但是包含左递归的语法除外)。自顶向下的语法分析器还有其他的一些优点,比如:易于调试,可以分析语法中的任何非终结符,可以在语法分析的过程中在语法分析树中上下传值等。
LARGE USER: COMMUNTIY:是一个用JAVA开发的最受欢迎的语法分析生成器。拥有成百上千的下载量和不计其数是使用者。我们的邮件列表(https://javacc.dev.java.net/doc/mailinglist.html )和新闻组(comp.compilers.tools.JavaCC)里的参与者有1000多人。
LEXICAL AND GRAMMAR SPECIFICATIONS IN ONE FILE:词法规范(如正则表达式、字符串等)和语法规范(BNF范式)书写在同一个文件里。这使得语法易读和易维护。
TREE BUILDING PREPROCESSOR:JavaCC提供的JJTree工具,是一个强有力的语法树构造的预处理程序。
EXTREMELY CUSTOMIZABLE:JavaCC提供了多种不同的选项供用户自定义JavaCC的行为和它所产生的语法分析器的行为。
CERTIFIED TO BE 100% PURE JAVA:JavaCC可以在任何java平台V1.1以后的版本上运行。它可以不需要特别的移植工作便可在多种机器上运行。是Java语言“Write Once, Run Everywhere”特性的证明。
DOCUMENT GENERATION:JavaCC包括一个叫JJDoc的工具,它可以把文法文件转换成文本本件(Html).
MANY MANY EXAMPLES:JavaCC的发行版包括一系列的包括Java和HTML文法的例子。这些例子和相应的文档是学习JavaCC的捷径。
INTERNATIONALIZED:JavaCC的词法分析器可以处理全部的Unicode输入,并且词法规范何以包括任意的Unicode字符。这使得语言元素的描述,例如Java标识符变得容易。
SYNTACTIC AND SEMANTIC LOOKAHEAD SPECIFICATIONS:默认的,JavaCC产生的是LL(1)的语法分析器,然而有许多语法不是LL(1)的。JavaCC提供了根据语法和语义向前看的能力来解决在一些局部的移进-归约的二义性。例如,一个LL(k)的语法分析器只在这些有移进-归约冲突的地方保持LL(k),而在其他地方为了更好的效率而保持LL(1)。移进-归约和归约-归约冲突不是自顶向下语法分析器的问题。
PERMITS EXTENDED BNF SPECIFICATIONS:JavaCC允许拓展的BNF范式——例如(A),(A)+等。 拓展的BNF范式在某种程度上解决了左递归。 事实上,拓展的BNF范式写成A ::= y(x) 或 A ::= Ax|y更容易阅读。
LEXICAL STATES AND LEXICAL ACTIONS:JavaCC提供了像lex的词法状态和词法动作的能力。
CASE-INSENSITIVE LEXICAL ANALYSIS:词法描述可以在整个词法描述的全局域或者独立的词法描述中定义大小写不敏感的Tokens。
EXTENSIVE DEBUGGING CAPABILITIES:使用选项DEBUG_PARSER, DEBUG_LOOKAHEAD, 和 DEBUG_TOKEN_MANAGER,使用者可以在语法分析和Token处理中使用深层次的分析。
SPECIAL TOKENS:Tokens可以在词法说明中被定义成特殊的Tokens从而在语法分析的过程中被忽略,但这些Tokens可以通过工具进行处理。
VERY GOOD ERROR REPORTING:JavaCC的错误提示在众多语法分析生成器中是最好的。JavaCC产生的语法分析器可以清楚的指出语法分析的错误并提供完整的诊断信息。



https://javacc.github.io/javacc/



https://www.cnblogs.com/forfuture1978/archive/2010/05/08/1730200.html



https://www.cnblogs.com/laud/p/anltrv4_1.html



https://blog.csdn.net/sherrywong1220/article/details/53697737?locationNum=10&fps=1



https://blog.csdn.net/yuexiang321/article/details/52770283?locationNum=6&fps=1



https://prestodb.io/



https://tech.meituan.com/2014/06/16/presto.html
https://dev.mysql.com/doc/refman/5.6/en/innodb-storage-engine.html



https://redis.io/
https://rocksdb.org/
https://github.com/pingcap/tidb
https://github.com/manuzhang/awesome-streaming
https://www.ibm.com/support/knowledgecenter/zh/ssw_aix_71/generalprogramming/chapter13.html



https://godoc.org/golang.org/x/tools/cmd/goyacc



https://blog.gopheracademy.com/advent-2017/parsing-with-antlr4-and-go/



https://esprima.org/demo/parse.html



https://astexplorer.net/



http://dinosaur.compilertools.net/yacc/



https://github.com/antlr/grammars-v4/blob/master/properties/properties.g4



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



js
https://github.com/antlr/grammars-v4/blob/master/javascript/JavaScriptLexer.g4
https://github.com/antlr/grammars-v4/blob/master/javascript/JavaScriptParser.g4



https://stackoverflow.com/questions/42478661/difference-between-export-and-export-default-in-javascript



https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export



php
https://github.com/antlr/grammars-v4/blob/master/php/PhpLexer.g4
https://github.com/antlr/grammars-v4/blob/master/php/PhpParser.g4


Category golang