Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
trs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
trs
Commits
70ee2aaa
Commit
70ee2aaa
authored
13 years ago
by
Sander Mathijs van Veen
Browse files
Options
Downloads
Patches
Plain Diff
Removed deprecated concat grammar.
parent
5f68d635
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/parser.py
+1
-35
1 addition, 35 deletions
src/parser.py
with
1 addition
and
35 deletions
src/parser.py
+
1
−
35
View file @
70ee2aaa
...
@@ -55,7 +55,7 @@ class Parser(BisonParser):
...
@@ -55,7 +55,7 @@ class Parser(BisonParser):
# of tokens of the lex script.
# of tokens of the lex script.
tokens
=
[
'
NUMBER
'
,
'
IDENTIFIER
'
,
tokens
=
[
'
NUMBER
'
,
'
IDENTIFIER
'
,
'
PLUS
'
,
'
MINUS
'
,
'
TIMES
'
,
'
DIVIDE
'
,
'
POW
'
,
'
PLUS
'
,
'
MINUS
'
,
'
TIMES
'
,
'
DIVIDE
'
,
'
POW
'
,
'
LPAREN
'
,
'
RPAREN
'
,
'
COMMA
'
,
# 'CONCAT_POW',
'
LPAREN
'
,
'
RPAREN
'
,
'
COMMA
'
,
'
NEWLINE
'
,
'
QUIT
'
,
'
RAISE
'
,
'
GRAPH
'
]
'
NEWLINE
'
,
'
QUIT
'
,
'
RAISE
'
,
'
GRAPH
'
]
# ------------------------------
# ------------------------------
...
@@ -287,40 +287,6 @@ class Parser(BisonParser):
...
@@ -287,40 +287,6 @@ class Parser(BisonParser):
raise
BisonSyntaxError
(
'
Unsupported option %d in target
"
%s
"
.
'
raise
BisonSyntaxError
(
'
Unsupported option %d in target
"
%s
"
.
'
%
(
option
,
target
))
# pragma: nocover
%
(
option
,
target
))
# pragma: nocover
#def on_concat(self, option, target, names, values):
# """
# concat : exp IDENTIFIER %prec TIMES
# | exp NUMBER %prec TIMES
# | exp LPAREN exp RPAREN %prec TIMES
# | exp CONCAT_POW %prec TIMES
# | CONCAT_POW
# """
# if option in [0, 1]: # rule: exp IDENTIFIER | exp NUMBER
# # example: xy -> x*y
# # example: (x)4 -> x*4
# val = int(values[1]) if option == 1 else values[1]
# return Node('*', *(combine('*', values[0]) + [Leaf(val)]))
# if option == 2: # rule: exp LPAREN exp RPAREN
# # example: x(y) -> x*(y)
# return Node('*', *(combine('*', values[0])
# + combine('*', values[2])))
# if option == 3:
# # example: xy4 -> x*y^4
# identifier, exponent = list(values[1])
# node = Node('^', Leaf(identifier), Leaf(int(exponent)))
# return Node('*', values[0], node)
# if option == 4:
# # example: x4 -> x^4
# identifier, exponent = list(values[0])
# return Node('^', Leaf(identifier), Leaf(int(exponent)))
# raise BisonSyntaxError('Unsupported option %d in target "%s".'
# % (option, target)) # pragma: nocover
# -----------------------------------------
# -----------------------------------------
# raw lex script, verbatim here
# raw lex script, verbatim here
# -----------------------------------------
# -----------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment