Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
f5beef74
Commit
f5beef74
authored
Nov 25, 2010
by
Paweł Kędzia
Browse files
Options
Downloads
Patches
Plain Diff
Fixed the conditional operators grammar. Added RBRACKET token to rules.
parent
28bb7435
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libwccl/parser/grammar.g
+22
-23
22 additions, 23 deletions
libwccl/parser/grammar.g
with
22 additions
and
23 deletions
libwccl/parser/grammar.g
+
22
−
23
View file @
f5beef74
...
...
@@ -224,7 +224,9 @@ sym_set_literal
t_set.reset(new Wccl::TSet());
}
: LCURLY RCURLY
| LCURLY sym_set_elem[tagset, t_set] (COMMA sym_set_elem[tagset, t_set]) *
| LCURLY
sym_set_elem[tagset, t_set] (COMMA sym_set_elem[tagset, t_set]) *
RCURLY
;
// Constant symbol set
// Returns boost::shared_ptr<Wccl::Constant<Wccl::TSet> >
...
...
@@ -519,7 +521,7 @@ condit_sym
: "if" LPAREN test = logical_predicates [tagset, vars] COMMA
p_true = sym_set_operators [tagset, vars]
(COMMA p_false = sym_set_operators [tagset, vars])?
{
RPAREN
{
if (p_false) {
op.reset(new Wccl::Conditional<Wccl::TSet>(test, p_true, p_false));
}
...
...
@@ -528,9 +530,11 @@ condit_sym
}
}
| Q_MARK
(p_true = sym_set_operators [tagset, vars] | p_true = condit_sym [tagset, vars])
(p_true = sym_set_operators [tagset, vars] |
p_true = condit_sym [tagset, vars])
Q_MARK
(test = logical_predicates [tagset, vars] | test = condit_bool [tagset, vars])
(test = logical_predicates [tagset, vars] |
test = condit_bool [tagset, vars])
{
op.reset(new Wccl::Conditional<Wccl::TSet>(test, p_true));
}
...
...
@@ -622,7 +626,9 @@ op_affix
{
boost::shared_ptr<Wccl::Function<Wccl::StrSet> > o_ret;
}
: "affix" LPAREN o_ret = string_operators[tagset, vars] COMMA offset: INT RPAREN {
: "affix" LPAREN
o_ret = string_operators[tagset, vars] COMMA
offset: INT RPAREN {
ret.reset(new Wccl::Affix(o_ret, token_ref_to_int(offset)));
}
;
...
...
@@ -646,7 +652,7 @@ condit_str
: "if" LPAREN test = logical_predicates [tagset, vars] COMMA
p_true = string_operators [tagset, vars]
(COMMA p_false = string_operators [tagset, vars])?
{
RPAREN
{
if (p_false) {
op.reset(new Wccl::Conditional<Wccl::StrSet>(test, p_true, p_false));
}
...
...
@@ -655,9 +661,11 @@ condit_str
}
}
| Q_MARK
(p_true = string_operators [tagset, vars] | p_true = condit_str [tagset, vars])
(p_true = string_operators [tagset, vars] |
p_true = condit_str [tagset, vars])
Q_MARK
(test = logical_predicates [tagset, vars] | test = condit_bool [tagset, vars])
(test = logical_predicates [tagset, vars] |
test = condit_bool [tagset, vars])
{
op.reset(new Wccl::Conditional<Wccl::StrSet>(test, p_true));
}
...
...
@@ -852,7 +860,7 @@ condit_bool
: "if" LPAREN test = logical_predicates [tagset, vars] COMMA
p_true = logical_predicates [tagset, vars]
(COMMA p_false = logical_predicates [tagset, vars])?
{
RPAREN
{
if (p_false) {
op.reset(new Wccl::Conditional<Wccl::Bool>(test, p_true, p_false));
}
...
...
@@ -861,9 +869,11 @@ condit_bool
}
}
| Q_MARK
(p_true = logical_predicates [tagset, vars] | p_true = condit_bool [tagset, vars])
(p_true = logical_predicates [tagset, vars] |
p_true = condit_bool [tagset, vars])
Q_MARK
(test = logical_predicates [tagset, vars] | test = condit_bool [tagset, vars])
(test = logical_predicates [tagset, vars] |
test = condit_bool [tagset, vars])
{
op.reset(new Wccl::Conditional<Wccl::Bool>(test, p_true));
}
...
...
@@ -878,8 +888,7 @@ class ANTLRLexer extends Lexer;
options {
exportVocab = ANTLRExpr;
charVocabulary = '\3'..'\377';
// testLiterals = false;
k = 4;
k = 3;
}
STRING
...
...
@@ -1018,16 +1027,6 @@ options {
: '}'
;
/*
DOLLAR
options {
paraphrase = "'$'";
testLiterals = true;
}
: '$'
;
*/
AT_MARK
options {
paraphrase = "'@'";
...
...
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