Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
general
stups
SableCC STUPS
Commits
e1c0a972
Commit
e1c0a972
authored
Mar 10, 2017
by
hansen
Browse files
support performance optimisations
parent
2546f06d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/resources/org/sablecc/sablecc/parser.txt
View file @
e1c0a972
...
...
@@ -184,6 +184,10 @@ public class Parser implements IParser
+ token.getText().length());
}
protected boolean addElementsFromListToNewList(String productionRuleAsString) {
return true;
}
$
Macro:ParserInliningPushHeader
...
...
@@ -399,13 +403,14 @@ Macro:ParserNewHeader
{
this.firstPopped = null;
this.lastPopped = null;
ArrayList nodeList = new ArrayList();
final boolean addElementsToNewList = addElementsFromListToNewList("$1$");
ArrayList nodeList = new ArrayList();
$
Macro:ParserNewBodyDecl
ArrayList nodeArrayList$0$ = pop();
ArrayList nodeArrayList$0$ = pop();
$
...
...
@@ -464,32 +469,35 @@ Macro:ParserNewBodyNewTail
$
Macro:ParserTypedLinkedListAdd
if($2$Node$3$ != null)
{
$0$Node$1$.add($2$Node$3$);
}
if($2$Node$3$ != null)
{
$0$Node$1$.add($2$Node$3$);
}
$
Macro:ParserTypedLinkedListAddAll
if($2$Node$3$ != null) //Macro:ParserTypedLinkedListAddAll
{
$0$Node$1$.addAll($2$Node$3$);
//$0$Node$1$ = $2$Node$3$;
if(addElementsToNewList){
$0$Node$1$.addAll($2$Node$3$);
}else{
$0$Node$1$ = $2$Node$3$;
}
}
$
Macro:ParserTypedLinkedListAddAll2
if($2$ != null) //Macro:ParserTypedLinkedListAddAll2
{
$0$Node$1$.addAll($2$);
}
if($2$ != null) //Macro:ParserTypedLinkedListAddAll2
{
$0$Node$1$.addAll($2$);
}
$
Macro:ParserNewBodyListAdd
nodeList.add($0$Node$1$);
nodeList.add($0$Node$1$);
$
...
...
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