diff --git a/antlr4-maven-plugin/pom.xml b/antlr4-maven-plugin/pom.xml index 76e9bd37f..fa58b32b3 100644 --- a/antlr4-maven-plugin/pom.xml +++ b/antlr4-maven-plugin/pom.xml @@ -120,7 +120,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.3 + 3.6.0 true diff --git a/contributors.txt b/contributors.txt index 43980f1b0..a11dc27f2 100644 --- a/contributors.txt +++ b/contributors.txt @@ -226,29 +226,37 @@ YYYY/MM/DD, github id, Full name, email 2019/03/13, base698, Justin Thomas, justin.thomas1@gmail.com 2019/03/18, carlodri, Carlo Dri, carlo.dri@gmail.com 2019/05/02, askingalot, Andy Collins, askingalot@gmail.com +2019/05/13, mapio, Massimo Santini, massimo.santini@gmail.com 2019/07/11, olowo726, Olof Wolgast, olof@baah.se 2019/07/16, abhijithneilabraham, Abhijith Neil Abraham, abhijithneilabrahampk@gmail.com 2019/07/26, Braavos96, Eric Hettiaratchi, erichettiaratchi@gmail.com +2019/08/02, thron7, Thomas Herchenroeder, thron7[at]users[dot]sourceforge[dot]net +2019/08/12, easonlin404, Eason Lin, easonlin404@gmail.com 2019/08/23, akaJes, Oleksandr Mamchyts, akaJes@gmail.com +2019/08/27, wurzelpeter, Markus Franke, markus[hyphen]franke[at]web[dot]de 2019/09/10, ImanHosseini, Iman Hosseini, hosseini.iman@yahoo.com 2019/09/03, João Henrique, johnnyonflame@hotmail.com 2019/09/10, neko1235, Ihar Mokharau, igor.mohorev@gmail.com 2019/09/10, yar3333, Yaroslav Sivakov, yar3333@gmail.com 2019/09/10, marcospassos, Marcos Passos, marcospassos.com@gmail.com 2019/09/10, amorimjuliana, Juliana Amorim, juu.amorim@gmail.com +2019/09/15, sullis, Sean Sullivan, github@seansullivan.com 2019/09/17, kaz, Kazuki Sawada, kazuki@6715.jp 2019/09/28, lmy269, Mingyang Liu, lmy040758@gmail.com 2019/10/29, tehbone, Tabari Alexander, tehbone@gmail.com 2019/10/31, a-square, Alexei Averchenko, lex.aver@gmail.com +2019/11/05, listba, Ben List, ben.list89@gmail.com 2019/11/11, foxeverl, Liu Xinfeng, liuxf1986[at]gmail[dot]com 2019/11/17, felixn, Felix Nieuwenhuizhen, felix@tdlrali.com 2019/11/18, mlilback, Mark Lilback, mark@lilback.com 2020/01/19, lingyv-li, Lingyu Li, lingyv.li@gmail.com 2020/02/02, carocad, Camilo Roca, carocad@unal.edu.co 2020/02/10, julibert, Julián Bermúdez Ortega, julibert.dev@gmail.com +2020/02/17, quantumsheep, Nathanael Demacon, nathanael.dmc@outlook.fr 2020/02/21, StochasticTinkr, Daniel Pitts, github@coloraura.com 2020/03/17, XsongyangX, Song Yang, songyang1218@gmail.com 2020/04/07, deniskyashif, Denis Kyashif, denis.kyashif@gmail.com +2020/04/08, lwehmeier, Leon Wehmeier, wehmeier@st.ovgu.de 2020/04/10, agrabski, Adam Grabski, adam.gr@outlook.com 2020/04/23, martinvw, Martin van Wingerden, martin@martinvw.nl 2020/04/30, TristonianJones, Tristan Swadell, tswadell@google.com diff --git a/doc/actions.md b/doc/actions.md index ef51c8f4c..9eb61eb52 100644 --- a/doc/actions.md +++ b/doc/actions.md @@ -84,7 +84,7 @@ Using a rule label looks like this: returnStat : 'return' e=expr {System.out.println("matched "+e.text);} ; ``` -You can also use `$ followed by the name of the attribute to access the value associated with the currently executing rule. For example, `$start` is the starting token of the current rule. +You can also use `$` followed by the name of the attribute to access the value associated with the currently executing rule. For example, `$start` is the starting token of the current rule. ``` returnStat : 'return' expr {System.out.println("first token "+$start.getText());} ; diff --git a/doc/cpp-target.md b/doc/cpp-target.md index 43e1c6bb0..910648e42 100644 --- a/doc/cpp-target.md +++ b/doc/cpp-target.md @@ -1,6 +1,6 @@ # C++ -The C++ target supports all platforms that can either run MS Visual Studio 2013 (or newer), XCode 7 (or newer) or CMake (C++11 required). All build tools can either create static or dynamic libraries, both as 64bit or 32bit arch. Additionally, XCode can create an iOS library. Also see [Antlr4 for C++ with CMake: A practical example](https://beyondtheloop.dev/Antlr-cpp-cmake/). +The C++ target supports all platforms that can either run MS Visual Studio 2013 (or newer), XCode 7 (or newer) or CMake (C++11 required). All build tools can either create static or dynamic libraries, both as 64bit or 32bit arch. Additionally, XCode can create an iOS library. Also see [Antlr4 for C++ with CMake: A practical example](http://blorente.me/beyond-the-loop/Antlr-cpp-cmake/). ## How to create a C++ lexer or parser? This is pretty much the same as creating a Java lexer or parser, except you need to specify the language target, for example: diff --git a/doc/go-target.md b/doc/go-target.md index 4f7e64e05..695f1564f 100644 --- a/doc/go-target.md +++ b/doc/go-target.md @@ -65,7 +65,7 @@ Another common option to the ANTLR tool is `-visitor`, which generates a parse t We'll write a small main func to call the generated parser/lexer (assuming they are separate). This one writes out the encountered `ParseTreeContext`'s. Suppose the gen'ed parser code is in the `parser` directory relative to this code: -``` +```golang package main import ( diff --git a/doc/lexer-rules.md b/doc/lexer-rules.md index 0f14df3d4..6b4912118 100644 --- a/doc/lexer-rules.md +++ b/doc/lexer-rules.md @@ -25,7 +25,7 @@ fragment DIGIT : [0-9] ; // not a token by itself ## Lexical Modes -Modes allow you to group lexical rules by context, such as inside and outside of XML tags. It’s like having multiple sublexers, one for context. The lexer can only return tokens matched by entering a rule in the current mode. Lexers start out in the so-called default mode. All rules are considered to be within the default mode unless you specify a mode command. Modes are not allowed within combined grammars, just lexer grammars. (See grammar `XMLLexer` from [Tokenizing XML](http://pragprog.com/book/tpantlr2/the-definitive-antlr-4-reference).) +Modes allow you to group lexical rules by context, such as inside and outside of XML tags. It’s like having multiple sublexers, one for each context. The lexer can only return tokens matched by entering a rule in the current mode. Lexers start out in the so-called default mode. All rules are considered to be within the default mode unless you specify a mode command. Modes are not allowed within combined grammars, just lexer grammars. (See grammar `XMLLexer` from [Tokenizing XML](http://pragprog.com/book/tpantlr2/the-definitive-antlr-4-reference).) ``` rules in default mode @@ -125,7 +125,7 @@ ESC : '\\' . ; // match any escaped \x character {«action»} -Lexer actions can appear anywhere as of 4.2, not just at the end of the outermost alternative. The lexer executes the actions at the appropriate input position, according to the placement of the action within the rule. To execute a single action for a role that has multiple alternatives, you can enclose the alts in parentheses and put the action afterwards: +Lexer actions can appear anywhere as of 4.2, not just at the end of the outermost alternative. The lexer executes the actions at the appropriate input position, according to the placement of the action within the rule. To execute a single action for a rule that has multiple alternatives, you can enclose the alts in parentheses and put the action afterwards:
 END : ('endif'|'end') {System.out.println("found an end");} ;
diff --git a/doc/lexicon.md b/doc/lexicon.md
index 637a2fdea..92081575a 100644
--- a/doc/lexicon.md
+++ b/doc/lexicon.md
@@ -26,8 +26,8 @@ The Javadoc comments are hidden from the parser and are ignored at the moment.
 Token names always start with a capital letter and so do lexer rules as defined by Java’s `Character.isUpperCase` method. Parser rule names always start with a lowercase letter (those that fail `Character.isUpperCase`). The initial character can be followed by uppercase and lowercase letters, digits, and underscores. Here are some sample names:
 
 ```
-ID, LPAREN, RIGHT_CURLY // token names/rules
-expr, simpleDeclarator, d2, header_file // rule names
+ID, LPAREN, RIGHT_CURLY // token names/lexer rules
+expr, simpleDeclarator, d2, header_file // parser rule names
 ```
 
 Like Java, ANTLR accepts Unicode characters in ANTLR names:
diff --git a/doc/tree-matching.md b/doc/tree-matching.md
index f4c6d278c..b0ec83bb5 100644
--- a/doc/tree-matching.md
+++ b/doc/tree-matching.md
@@ -52,15 +52,6 @@ m.setDelimiters("<<", ">>", "$"); // $ is the escape character
 
 This would allow pattern `<> = <> ;$<< ick $>>` to be interpreted as elements: `ID`, ` = `, `expr`, and ` ;<< ick >>`.
 
-```java
-String xpath = "//blockStatement/*";
-String treePattern = "int  = ;";
-ParseTreePattern p =
-parser.compileParseTreePattern(treePattern,
-JavaParser.RULE_localVariableDeclarationStatement);
-List matches = p.findAll(tree, xpath);
-```
-
 ### Pattern labels
 
 The tree pattern matcher tracks the nodes in the tree at matches against the tags in a tree pattern. That way we can use the `get()` and `getAll()` methods to retrieve components of the matched subtree. For example, for pattern ``, `get("ID")` returns the node matched for that `ID`. If more than one node matched the specified token or rule tag, only the first match is returned. If there is no node associated with the label, this returns null.
diff --git a/pom.xml b/pom.xml
index 5286a1a8c..5c7a93549 100644
--- a/pom.xml
+++ b/pom.xml
@@ -151,7 +151,7 @@
 				
 					org.apache.maven.plugins
 					maven-compiler-plugin
-					3.6.0
+					3.8.1
 					
 						${maven.compiler.source}
 						${maven.compiler.target}
diff --git a/runtime/Cpp/README.md b/runtime/Cpp/README.md
index 3a3523c79..81d1f55ed 100644
--- a/runtime/Cpp/README.md
+++ b/runtime/Cpp/README.md
@@ -55,11 +55,11 @@ Either open the included XCode project and build that or use the cmake compilati
 Try run cmake -DCMAKE_ANDROID_NDK=/folder/of/android_ndkr17_and_above -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_API=14 -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_BUILD_TYPE=Release /folder/antlr4_src_dir -G Ninja.
 
 #### Compiling on Linux
-- cd /runtime/Cpp (this is where this readme is located)
+- cd \/runtime/Cpp (this is where this readme is located)
 - mkdir build && mkdir run && cd build
 - cmake .. -DANTLR_JAR_LOCATION=full/path/to/antlr4-4.5.4-SNAPSHOT.jar -DWITH_DEMO=True
 - make
-- DESTDIR=/runtime/Cpp/run make install
+- DESTDIR=\/runtime/Cpp/run make install
 
 If you don't want to build the demo then simply run cmake without parameters.
 There is another cmake script available in the subfolder cmake/ for those who prefer the superbuild cmake pattern.