Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ANTLR4 to 4.13.0 #470

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions antlr/GruleParserV3Listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strconv"
"strings"

"github.com/antlr/antlr4/runtime/Go/antlr"
"github.com/antlr4-go/antlr/v4"
"github.com/hyperjumptech/grule-rule-engine/antlr/parser/grulev3"
"github.com/hyperjumptech/grule-rule-engine/ast"
"github.com/hyperjumptech/grule-rule-engine/logger"
Expand All @@ -35,7 +35,7 @@ var (
"struct": "GruleParserV3Listener",
}

// LoggerV3 is a logger instance twith default fields for grule
// LoggerV3 is a logger instance with default fields for grule
LoggerV3 = logger.Log.WithFields(loggerV3Fields)
)

Expand Down
2 changes: 1 addition & 1 deletion antlr/GruleParserV3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"reflect"
"testing"

"github.com/antlr/antlr4/runtime/Go/antlr"
"github.com/antlr4-go/antlr/v4"
parser "github.com/hyperjumptech/grule-rule-engine/antlr/parser/grulev3"
"github.com/hyperjumptech/grule-rule-engine/ast"
"github.com/hyperjumptech/grule-rule-engine/pkg"
Expand Down
30 changes: 30 additions & 0 deletions antlr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# GNU Make >= 4.3

## Configuration

OUTPUT_DIR = parser/grulev3

ANTLR = antlr4
ANTLRFLAGS = -Dlanguage=Go -o '${OUTPUT_DIR}' -package '$(notdir ${OUTPUT_DIR})'

GRAMMAR = grulev3.g4

## Rules

PREFIX = ${OUTPUT_DIR}/$(basename ${GRAMMAR})
tokens = $(addsuffix .interp,$(1)) $(addsuffix .tokens,$(1))

TOKENS = $(call tokens,${PREFIX}Lexer) $(call tokens,${PREFIX})
LEXER = ${PREFIX}_lexer.go
PARSER = ${PREFIX}_parser.go ${PREFIX}_listener.go ${PREFIX}_base_listener.go ${PREFIX}_visitor.go ${PREFIX}_base_visitor.go

.PHONY: clean all
.DELETE_ON_ERROR:

all: ${TOKENS} ${LEXER} ${PARSER}

${TOKENS} ${LEXER} ${PARSER} &: ${GRAMMAR}
$(ANTLR) ${ANTLRFLAGS} -visitor $^

clean:
rm -f ${TOKENS} ${LEXER} ${PARSER}
Empty file modified antlr/parser/grulev3/grulev3.interp
100755 → 100644
Empty file.
160 changes: 80 additions & 80 deletions antlr/parser/grulev3/grulev3.tokens
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
T__0=1
PLUS=2
MINUS=3
DIV=4
MUL=5
MOD=6
DOT=7
SEMICOLON=8
LR_BRACE=9
RR_BRACE=10
LR_BRACKET=11
RR_BRACKET=12
LS_BRACKET=13
RS_BRACKET=14
RULE=15
WHEN=16
THEN=17
AND=18
OR=19
TRUE=20
FALSE=21
NIL_LITERAL=22
NEGATION=23
SALIENCE=24
EQUALS=25
ASSIGN=26
PLUS_ASIGN=27
MINUS_ASIGN=28
DIV_ASIGN=29
MUL_ASIGN=30
GT=31
LT=32
GTE=33
LTE=34
NOTEQUALS=35
BITAND=36
BITOR=37
SIMPLENAME=38
DQUOTA_STRING=39
SQUOTA_STRING=40
DECIMAL_FLOAT_LIT=41
DECIMAL_EXPONENT=42
HEX_FLOAT_LIT=43
HEX_EXPONENT=44
DEC_LIT=45
HEX_LIT=46
OCT_LIT=47
SPACE=48
COMMENT=49
LINE_COMMENT=50
','=1
'+'=2
'-'=3
'/'=4
'*'=5
'%'=6
'.'=7
';'=8
'{'=9
'}'=10
'('=11
')'=12
'['=13
']'=14
'&&'=18
'||'=19
'!'=23
'=='=25
'='=26
'+='=27
'-='=28
'/='=29
'*='=30
'>'=31
'<'=32
'>='=33
'<='=34
'!='=35
'&'=36
'|'=37
T__0=1
PLUS=2
MINUS=3
DIV=4
MUL=5
MOD=6
DOT=7
SEMICOLON=8
LR_BRACE=9
RR_BRACE=10
LR_BRACKET=11
RR_BRACKET=12
LS_BRACKET=13
RS_BRACKET=14
RULE=15
WHEN=16
THEN=17
AND=18
OR=19
TRUE=20
FALSE=21
NIL_LITERAL=22
NEGATION=23
SALIENCE=24
EQUALS=25
ASSIGN=26
PLUS_ASIGN=27
MINUS_ASIGN=28
DIV_ASIGN=29
MUL_ASIGN=30
GT=31
LT=32
GTE=33
LTE=34
NOTEQUALS=35
BITAND=36
BITOR=37
SIMPLENAME=38
DQUOTA_STRING=39
SQUOTA_STRING=40
DECIMAL_FLOAT_LIT=41
DECIMAL_EXPONENT=42
HEX_FLOAT_LIT=43
HEX_EXPONENT=44
DEC_LIT=45
HEX_LIT=46
OCT_LIT=47
SPACE=48
COMMENT=49
LINE_COMMENT=50
','=1
'+'=2
'-'=3
'/'=4
'*'=5
'%'=6
'.'=7
';'=8
'{'=9
'}'=10
'('=11
')'=12
'['=13
']'=14
'&&'=18
'||'=19
'!'=23
'=='=25
'='=26
'+='=27
'-='=28
'/='=29
'*='=30
'>'=31
'<'=32
'>='=33
'<='=34
'!='=35
'&'=36
'|'=37
Empty file modified antlr/parser/grulev3/grulev3Lexer.interp
100755 → 100644
Empty file.
160 changes: 80 additions & 80 deletions antlr/parser/grulev3/grulev3Lexer.tokens
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
T__0=1
PLUS=2
MINUS=3
DIV=4
MUL=5
MOD=6
DOT=7
SEMICOLON=8
LR_BRACE=9
RR_BRACE=10
LR_BRACKET=11
RR_BRACKET=12
LS_BRACKET=13
RS_BRACKET=14
RULE=15
WHEN=16
THEN=17
AND=18
OR=19
TRUE=20
FALSE=21
NIL_LITERAL=22
NEGATION=23
SALIENCE=24
EQUALS=25
ASSIGN=26
PLUS_ASIGN=27
MINUS_ASIGN=28
DIV_ASIGN=29
MUL_ASIGN=30
GT=31
LT=32
GTE=33
LTE=34
NOTEQUALS=35
BITAND=36
BITOR=37
SIMPLENAME=38
DQUOTA_STRING=39
SQUOTA_STRING=40
DECIMAL_FLOAT_LIT=41
DECIMAL_EXPONENT=42
HEX_FLOAT_LIT=43
HEX_EXPONENT=44
DEC_LIT=45
HEX_LIT=46
OCT_LIT=47
SPACE=48
COMMENT=49
LINE_COMMENT=50
','=1
'+'=2
'-'=3
'/'=4
'*'=5
'%'=6
'.'=7
';'=8
'{'=9
'}'=10
'('=11
')'=12
'['=13
']'=14
'&&'=18
'||'=19
'!'=23
'=='=25
'='=26
'+='=27
'-='=28
'/='=29
'*='=30
'>'=31
'<'=32
'>='=33
'<='=34
'!='=35
'&'=36
'|'=37
T__0=1
PLUS=2
MINUS=3
DIV=4
MUL=5
MOD=6
DOT=7
SEMICOLON=8
LR_BRACE=9
RR_BRACE=10
LR_BRACKET=11
RR_BRACKET=12
LS_BRACKET=13
RS_BRACKET=14
RULE=15
WHEN=16
THEN=17
AND=18
OR=19
TRUE=20
FALSE=21
NIL_LITERAL=22
NEGATION=23
SALIENCE=24
EQUALS=25
ASSIGN=26
PLUS_ASIGN=27
MINUS_ASIGN=28
DIV_ASIGN=29
MUL_ASIGN=30
GT=31
LT=32
GTE=33
LTE=34
NOTEQUALS=35
BITAND=36
BITOR=37
SIMPLENAME=38
DQUOTA_STRING=39
SQUOTA_STRING=40
DECIMAL_FLOAT_LIT=41
DECIMAL_EXPONENT=42
HEX_FLOAT_LIT=43
HEX_EXPONENT=44
DEC_LIT=45
HEX_LIT=46
OCT_LIT=47
SPACE=48
COMMENT=49
LINE_COMMENT=50
','=1
'+'=2
'-'=3
'/'=4
'*'=5
'%'=6
'.'=7
';'=8
'{'=9
'}'=10
'('=11
')'=12
'['=13
']'=14
'&&'=18
'||'=19
'!'=23
'=='=25
'='=26
'+='=27
'-='=28
'/='=29
'*='=30
'>'=31
'<'=32
'>='=33
'<='=34
'!='=35
'&'=36
'|'=37
4 changes: 2 additions & 2 deletions antlr/parser/grulev3/grulev3_base_listener.go
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions antlr/parser/grulev3/grulev3_base_visitor.go
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading