Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CUP Eclipse Plugin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr. Michael Petter
CUP Eclipse Plugin
Commits
8e4b63d8
Commit
8e4b63d8
authored
Dec 01, 2014
by
Johannes Roith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various fixes in the backend.
parent
4a8fdee5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
6 deletions
+21
-6
CupParser/src/de/in/tum/www2/cup/ast/LabeledProductionSymbolRef.java
...rc/de/in/tum/www2/cup/ast/LabeledProductionSymbolRef.java
+0
-3
CupParser/src/de/in/tum/www2/cup/ast/Production.java
CupParser/src/de/in/tum/www2/cup/ast/Production.java
+1
-1
CupParser/src/de/in/tum/www2/cup/ast/ProductionRight.java
CupParser/src/de/in/tum/www2/cup/ast/ProductionRight.java
+20
-2
No files found.
CupParser/src/de/in/tum/www2/cup/ast/LabeledProductionSymbolRef.java
View file @
8e4b63d8
...
...
@@ -7,9 +7,6 @@ public class LabeledProductionSymbolRef extends ProductionSymbolRef
{
public
String
label
;
// TODO: Name class?
// TODO: this should point to the declaration, after being resolved by a visitor.
public
Production
declaration
;
public
LabeledProductionSymbolRef
(
Name
name
,
String
label
,
Range
range
)
{
super
(
name
,
range
);
this
.
label
=
label
;
...
...
CupParser/src/de/in/tum/www2/cup/ast/Production.java
View file @
8e4b63d8
...
...
@@ -9,7 +9,7 @@ public class Production extends AbstractNode
implements
IWithName
,
IHasDeclarationReference
{
private
NonTerminal
declarationRef
;
private
Name
lhs
;
private
Name
lhs
;
// TODO: This should really be a NonTerminal class
private
List
<
ProductionRight
>
rhs
;
@Override
...
...
CupParser/src/de/in/tum/www2/cup/ast/ProductionRight.java
View file @
8e4b63d8
...
...
@@ -10,6 +10,7 @@ import de.in.tum.www2.cup.Range;
public
class
ProductionRight
extends
AbstractNode
{
private
List
<
IProductionRightPart
>
lst
;
private
Terminal
precedenceLike
;
private
int
index
;
private
List
<
Integer
>
extractedActionProductions
;
...
...
@@ -25,6 +26,10 @@ public class ProductionRight extends AbstractNode {
return
index
;
}
public
boolean
hasSpecifiedPrecedence
()
{
return
precedenceLike
!=
null
;
}
public
List
<
Integer
>
getExtractedActionProductions
()
{
return
extractedActionProductions
;
}
...
...
@@ -39,17 +44,23 @@ public class ProductionRight extends AbstractNode {
public
ProductionRight
(
int
index
,
List
<
Integer
>
extractedActionProductions
,
List
<
IProductionRightPart
>
lst
,
Range
range
)
{
List
<
IProductionRightPart
>
lst
,
Terminal
precedenceLike
,
Range
range
)
{
super
(
range
);
this
.
precedenceLike
=
precedenceLike
;
this
.
index
=
index
;
this
.
extractedActionProductions
=
extractedActionProductions
;
this
.
lst
=
lst
;
if
(
lst
!=
null
)
{
for
(
IProductionRightPart
prp
:
lst
)
for
(
IProductionRightPart
prp
:
lst
)
{
if
(
prp
!=
null
)
{
if
(
prp
instanceof
AbstractNode
)
((
AbstractNode
)
prp
).
setParent
(
this
);
}
if
(
precedenceLike
!=
null
)
precedenceLike
.
setParent
(
this
);
}
}
}
...
...
@@ -83,6 +94,8 @@ public class ProductionRight extends AbstractNode {
for
(
IProductionRightPart
ip
:
lst
)
ip
.
accept
(
visitor
,
childArg
);
}
if
(
precedenceLike
!=
null
)
precedenceLike
.
accept
(
visitor
,
childArg
);
}
visitor
.
postVisit
(
this
,
data
);
}
...
...
@@ -109,6 +122,11 @@ public class ProductionRight extends AbstractNode {
builder
.
append
(
","
);
builder
.
append
(
"\n"
);
}
if
(
precedenceLike
!=
null
)
{
builder
.
append
(
"%prec "
);
builder
.
append
(
precedenceLike
);
builder
.
append
(
"\n"
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment