Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SableCC STUPS
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
SableCC STUPS
Commits
56e3ba8d
Commit
56e3ba8d
authored
1 year ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Fix codegen for Null at top level in alternative transformation
parent
ff10f5e4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/sablecc/sablecc/GenerateAlternativeCodeForParser.java
+11
-8
11 additions, 8 deletions
...org/sablecc/sablecc/GenerateAlternativeCodeForParser.java
src/main/resources/org/sablecc/sablecc/parser.txt
+5
-0
5 additions, 0 deletions
src/main/resources/org/sablecc/sablecc/parser.txt
with
16 additions
and
8 deletions
src/main/java/org/sablecc/sablecc/GenerateAlternativeCodeForParser.java
+
11
−
8
View file @
56e3ba8d
...
...
@@ -124,19 +124,22 @@ public class GenerateAlternativeCodeForParser extends DepthFirstAdapter
position
=
CG
.
getTermNumbers
().
get
(
term
);
if
(
type_name
.
startsWith
(
"L"
))
if
(
"null"
.
equals
(
type_name
))
{
type_name
=
"list"
;
macros
.
apply
(
file
,
"ParserNewBodyListAddNull"
,
null
)
;
}
else
if
(
type_name
.
equals
(
"null"
))
else
{
type_name
=
"null"
;
if
(
type_name
.
startsWith
(
"L"
))
{
type_name
=
"list"
;
}
else
{
type_name
=
type_name
.
toLowerCase
();
}
macros
.
apply
(
file
,
"ParserNewBodyListAdd"
,
new
String
[]
{
type_name
,
""
+
position
});
}
}
if
(
popCount
>
0
)
{
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/org/sablecc/sablecc/parser.txt
+
5
−
0
View file @
56e3ba8d
...
...
@@ -390,6 +390,11 @@ Macro:ParserNewBodyListAdd
$
Macro:ParserNewBodyListAddNull
nodeList.add(null);
$
Macro:ParserNewCheck
checkResult(nodeList.get(0), nodeArrayList1, nodeArrayList$0$);
...
...
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