Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/antlr/grammars-v4 into wh…
Browse files Browse the repository at this point in the history
…enever
  • Loading branch information
teverett committed Jul 28, 2024
2 parents 1962914 + 9bdc0e2 commit 46f3f0a
Show file tree
Hide file tree
Showing 200 changed files with 11,619 additions and 1,022 deletions.
2 changes: 1 addition & 1 deletion .fake.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>fake</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
fetch-depth: 0
- name: Install Dotnet
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
dotnet-version: '8.0.x'
- name: Install Trash
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
echo ${{ steps.setup-php.outputs.php-version }}
php --version
- name: Install Dotnet
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
dotnet-version: '8.0.x'
- name: Test Dotnet
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
run: |
go version
- name: Install Python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: '3.10'
- name: Test Python
Expand All @@ -124,7 +124,7 @@ jobs:
run: |
pip install antlr4-tools
- name: Install JavaScript
uses: actions/[email protected].2
uses: actions/[email protected].3
with:
node-version: '21.7.3'
- name: Test JavaScript
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
with:
fetch-depth: 0
- name: Install Dotnet
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
dotnet-version: '8.0.x'
- name: Test Dotnet
Expand All @@ -196,7 +196,7 @@ jobs:
java --version
javac --version
- name: Install Python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: '3.10'
- name: Test Python
Expand Down
4 changes: 2 additions & 2 deletions _scripts/templates/CSharp/st.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ done
# Group parsing.
if [ "$global" == "" ]
then
echo "${files[*]}" | dotnet trwdog -- ./bin/Debug/net7.0/<if(os_win)>Test.exe<else>Test<endif> -q -x -tee -tree > parse.txt 2>&1
echo "${files[*]}" | dotnet trwdog -- ./bin/Debug/net8.0/<if(os_win)>Test.exe<else>Test<endif> -q -x -tee -tree > parse.txt 2>&1
else
echo "${files[*]}" | trwdog ./bin/Debug/net7.0/<if(os_win)>Test.exe<else>Test<endif> -q -x -tee -tree > parse.txt 2>&1
echo "${files[*]}" | trwdog ./bin/Debug/net8.0/<if(os_win)>Test.exe<else>Test<endif> -q -x -tee -tree > parse.txt 2>&1
fi
status=$?
<endif>
Expand Down
2 changes: 1 addition & 1 deletion _scripts/templates/PHP/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"antlr/antlr4-php-runtime": "0.9.1",
"phpunit/php-timer": "^5.0",
"phpunit/php-timer": "^7.0",
"php": "^8.0",
"ext-mbstring": "^8.0",
"psr/log": "^2.0 || ^3.0"
Expand Down
18 changes: 9 additions & 9 deletions _scripts/templates/Python3/st.Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,30 @@ def main(argv):
i = 1
while i \< len(argv):
arg = argv[i]
if arg in ("-tokens"):
if arg == "-tokens":
show_tokens = True
elif arg in ("-tree"):
elif arg == "-tree":
show_tree = True
elif arg in ("-prefix"):
elif arg == "-prefix":
i = i + 1
prefix = argv[i] + " "
elif arg in ("-input"):
elif arg == "-input":
i = i + 1
inputs.append(argv[i])
is_fns.append(False)
elif arg in ("-encoding"):
elif arg == "-encoding":
i = i + 1
encoding = argv[i]
elif arg in ("-tee"):
elif arg == "-tee":
tee = True
elif arg in ("-x"):
elif arg == "-x":
while f := sys.stdin.readline():
f = f.strip()
inputs.append(f)
is_fns.append(True)
elif arg in ("-q"):
elif arg == "-q":
quiet = True
elif arg in ("-trace"):
elif arg == "-trace":
show_trace = True
else:
inputs.append(argv[i])
Expand Down
3 changes: 1 addition & 2 deletions bcpl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>bcpl</artifactId>
<packaging>jar</packaging>
<name>khubla.com BCPL grammar</name>
<name>BCPL grammar</name>
<parent>
<groupId>org.antlr.grammars</groupId>
<artifactId>grammarsv4</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<build>
<sourceDirectory>Java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
Expand Down
1 change: 0 additions & 1 deletion bencoding/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<version>1.0-SNAPSHOT</version>
</parent>
<build>
<sourceDirectory>Java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
Expand Down
2 changes: 0 additions & 2 deletions bnf/examples/harvard.edu/readme.md

This file was deleted.

2 changes: 0 additions & 2 deletions bnf/examples/ics/readme.md

This file was deleted.

5 changes: 0 additions & 5 deletions bnf/examples/readme.md

This file was deleted.

3 changes: 2 additions & 1 deletion bnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<configuration>
<sourceDirectory>${basedir}</sourceDirectory>
<includes>
<include>bnf.g4</include>
<include>bnfLexer.g4</include>
<include>bnfParser.g4</include>
</includes>
<visitor>true</visitor>
<listener>true</listener>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 0 additions & 22 deletions cobol85/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
<artifactId>antlr4-maven-plugin</artifactId>
<version>${antlr.version}</version>
<configuration>
<sourceDirectory>${basedir}</sourceDirectory>
<includes>
<include>Cobol85.g4</include>
<include>Cobol85Preprocessor.g4</include>
</includes>
<visitor>true</visitor>
<listener>true</listener>
Expand All @@ -32,26 +30,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.khubla.antlr</groupId>
<artifactId>antlr4test-maven-plugin</artifactId>
<version>${antlr4test-maven-plugin.version}</version>
<configuration>
<verbose>false</verbose>
<showTree>false</showTree>
<entryPoint>startRule</entryPoint>
<grammarName>Cobol85</grammarName>
<packageName></packageName>
<exampleFiles>examples/</exampleFiles>
</configuration>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
17 changes: 6 additions & 11 deletions cpp/CPP14Parser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -699,30 +699,25 @@ abstractDeclarator
;

pointerAbstractDeclarator
: noPointerAbstractDeclarator
| pointerOperator+ noPointerAbstractDeclarator?
: pointerOperator* (noPointerAbstractDeclarator | pointerOperator)
;

noPointerAbstractDeclarator
: noPointerAbstractDeclarator (
: (parametersAndQualifiers | LeftParen pointerAbstractDeclarator RightParen) (
parametersAndQualifiers
| noPointerAbstractDeclarator LeftBracket constantExpression? RightBracket attributeSpecifierSeq?
)
| parametersAndQualifiers
| LeftBracket constantExpression? RightBracket attributeSpecifierSeq?
| LeftParen pointerAbstractDeclarator RightParen
| LeftBracket constantExpression? RightBracket attributeSpecifierSeq?
)*
;

abstractPackDeclarator
: pointerOperator* noPointerAbstractPackDeclarator
;

noPointerAbstractPackDeclarator
: noPointerAbstractPackDeclarator (
: Ellipsis (
parametersAndQualifiers
| LeftBracket constantExpression? RightBracket attributeSpecifierSeq?
)
| Ellipsis
)*
;

parameterDeclarationClause
Expand Down
4 changes: 4 additions & 0 deletions cpp/examples/g4-4149.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Test<char(*)[21]> type;
Test<void(*)(void)> type;
Test<char(&)[21]> type;
Test<char(&&)[21]> type;
1 change: 0 additions & 1 deletion cpp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<version>1.0-SNAPSHOT</version>
</parent>
<build>
<sourceDirectory>Java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
Expand Down
1 change: 0 additions & 1 deletion csharp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<version>1.0-SNAPSHOT</version>
</parent>
<build>
<sourceDirectory>Java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
Expand Down
3 changes: 1 addition & 2 deletions databank/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>databank</artifactId>
<packaging>jar</packaging>
<name>khubla.com databank grammar</name>
<name>databank grammar</name>
<parent>
<groupId>org.antlr.grammars</groupId>
<artifactId>grammarsv4</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<build>
<sourceDirectory>Java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fortran/fortran77/desc.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<desc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../_scripts/desc.xsd">
<antlr-version>^4.13.0</antlr-version>
<targets>Cpp;CSharp;Dart;Go;Java;JavaScript;PHP;Python3;TypeScript</targets>
<targets>Cpp;CSharp;Dart;Go;Java;JavaScript;PHP;Python3</targets>
</desc>
1 change: 0 additions & 1 deletion fortran/fortran77/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<version>1.0-SNAPSHOT</version>
</parent>
<build>
<sourceDirectory>Java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
Expand Down
1 change: 0 additions & 1 deletion fortran/fortran90/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<version>1.0-SNAPSHOT</version>
</parent>
<build>
<sourceDirectory>Java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
Expand Down
3 changes: 1 addition & 2 deletions gdscript/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>gdscript</artifactId>
<packaging>jar</packaging>
<name>Python3 grammar</name>
<name>GDScript grammar</name>
<parent>
<groupId>org.antlr.grammars</groupId>
<artifactId>grammarsv4</artifactId>
Expand All @@ -14,7 +14,6 @@
<src.dir>Java</src.dir>
</properties>
<build>
<sourceDirectory>${src.dir}</sourceDirectory>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
Expand Down
Loading

0 comments on commit 46f3f0a

Please sign in to comment.