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 May 30, 2024
2 parents f877f05 + 7f01b95 commit 1962914
Show file tree
Hide file tree
Showing 169 changed files with 14,694 additions and 288 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
- name: Install JavaScript
uses: actions/[email protected]
with:
node-version: '21.7.1'
node-version: '21.7.3'
- name: Test JavaScript
run: |
node --version
Expand Down
88 changes: 0 additions & 88 deletions .github/workflows/perf.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ out
# Ignore downloaded temporaries create by _scripts/get-antlr.ps1
antlr4-*-complete.jar

node_modules
package-lock.json
6 changes: 3 additions & 3 deletions _scripts/mkindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ def index_grammars(root : str) -> Sequence[dict]:
parser = grammars[0] if 'Parser' in grammars[0] else grammars[1]
gdir = path[len(root)+1:]
if lexer:
lexer = f'https://raw.githubusercontent.com/antlr/grammars-v4/master/{gdir}/{lexer}'
lexer = f'https://raw.githubusercontent.com/antlr/grammars-v4/master/{gdir}/{lexer}'.replace('\\','/')
if parser:
parser = f'https://raw.githubusercontent.com/antlr/grammars-v4/master/{gdir}/{parser}'
parser = f'https://raw.githubusercontent.com/antlr/grammars-v4/master/{gdir}/{parser}'.replace('\\','/')
else:
lexer = ""
parser = grammars[0]
gdir = path[len(root)+1:]
if parser:
parser = f'https://raw.githubusercontent.com/antlr/grammars-v4/master/{gdir}/{parser}'
parser = f'https://raw.githubusercontent.com/antlr/grammars-v4/master/{gdir}/{parser}'.replace('\\','/')

exampleFilesDir = get_single_value("exampleFiles", pom)
if exampleFilesDir is None:
Expand Down
151 changes: 148 additions & 3 deletions fortran/fortran90/Fortran90Parser.g4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Fortran 90 grammar for ANTLR 4.8
* Adadpted from Fortran 90 PCCTS grammar by Cyrille MIDINGOYI
* Original PCCTS grammar by Terence Parr
Expand Down Expand Up @@ -497,7 +497,152 @@ entityDecl
;

objectName
: name
;

name
: NAME
| ACCESS
| ACCESSSPEC
| ACTION
| ADVANCE
| AIF
| ALLOCATABLE
| ALLOCATE
| ASSIGNMENT
| ASSIGNSTMT
| BACKSPACE
| BLOCK
| BLOCKDATA
| CALL
| CASE
| CCON
| CHARACTER
| CLOSE
| CODEROOT
| COMMON
| COMPLEX
| CONCATOP
| CONTAINS
| CONTINUE
| CTRLDIRECT
| CTRLREC
| CYCLE
| DATA
| DEALLOCATE
| DEFAULT
| DELIM
| DIMENSION
| DIRECT
| DO
| DOBLOCK
| DOUBLE
| DOUBLEPRECISION
| ELSE
| ELSEBLOCK
| ELSEIF
| ELSEWHERE
| END
| ENDBLOCK
| ENDBLOCKDATA
| ENDDO
| ENDFILE
| ENDIF
| ENDINTERFACE
| ENDMODULE
| ENDSELECT
| ENDTYPE
| ENDWHERE
| ENTRY
| EQUIVALENCE
| ERR
| EXIST
| EXTERNAL
| FILE
| FMT
| FORM
| FORMAT
| FORMATTED
| FUNCTION
| GO
| GOTO
| HOLLERITH
| IF
| IMPLICIT
| IN
| INCLUDE
| INOUT
| INQUIRE
| INTEGER
| INTENT
| INTERFACE
| INTRINSIC
| IOLENGTH
| IOSTART
| IOSTAT
| KIND
| LABEL
| LEN
| LET
| LOGICAL
| MODULE
| NAME_
| NAMED
| NAMELIST
| NEXTREC
| NML
| NONE
| NULLIFY
| NUMBER
| ONLY
| OPEN
| OPENED
| OPERATOR
| OPTIONAL
| OUT
| PAD
| PARAMETER
| PAUSE
| POINTER
| POSITION
| PRECISION
| PRINT
| PRIVATE
| PROCEDURE
| PROGRAM
| READ
| READWRITE
| REAL
| REC
| RECL
| RECURSIVE
| RESULT
| RETURN
| REWIND
| SAVE
| SELECT
| SELECTCASE
| SEQUENCE
| SEQUENTIAL
| SIZE
| SPOFF
| SPON
| STAT
| STATUS
| STOP
| SUBPROGRAMBLOCK
| SUBROUTINE
| TARGET
| THEN
| THENBLOCK
| TO
| TYPE
| UNFORMATTED
| UNIT
| USE
| WHERE
| WHILE
| WRITE
;

arraySpec
Expand Down Expand Up @@ -1774,7 +1919,7 @@ functionArg
;

nameDataRef
: (NAME | REAL | SIZE) complexDataRefTail*
: name complexDataRefTail*
;

complexDataRefTail
Expand Down Expand Up @@ -1835,4 +1980,4 @@ constantExpr

ifStmt
: IF LPAREN expression RPAREN actionStmt
;
;
10 changes: 5 additions & 5 deletions fortran/fortran90/desc.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<desc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../_scripts/desc.xsd">
<targets>Antlr4ng;Cpp;CSharp;Dart;Go;Java;JavaScript;Python3</targets>
<test>
<name>small</name>
<targets>JavaScript;Python3</targets>
<inputs>small</inputs>
</test>
<test>
<name>large</name>
<targets>Antlr4ng;Cpp;CSharp;Dart;Go;Java</targets>
<inputs>examples</inputs>
</test>
<test>
<name>small</name>
<targets>JavaScript;Python3</targets>
<inputs>small</inputs>
</test>
</desc>
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-access.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: access
call some_routine(access)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-accessspec.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: accessspec
call some_routine(accessspec)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-action.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: action
call some_routine(action)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-advance.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: advance
call some_routine(advance)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-aif.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: aif
call some_routine(aif)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-allocatable.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: allocatable
call some_routine(allocatable)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-allocate.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: allocate
call some_routine(allocate)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-assignment.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: assignment
call some_routine(assignment)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-assignstmt.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: assignstmt
call some_routine(assignstmt)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-backspace.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: backspace
call some_routine(backspace)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-block.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: block
call some_routine(block)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-blockdata.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: blockdata
call some_routine(blockdata)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-call.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: call
call some_routine(call)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-case.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: case
call some_routine(case)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-ccon.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: ccon
call some_routine(ccon)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-character.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: character
call some_routine(character)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-close.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: close
call some_routine(close)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-coderoot.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: coderoot
call some_routine(coderoot)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-common.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: common
call some_routine(common)
end
3 changes: 3 additions & 0 deletions fortran/fortran90/examples/4105-complex.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
integer(4) :: complex
call some_routine(complex)
end
Loading

0 comments on commit 1962914

Please sign in to comment.