diff options
author | 2020-05-08 21:02:33 +0200 | |
---|---|---|
committer | 2020-05-08 21:02:33 +0200 | |
commit | 771e3773bb7ebbf6712724cb2b248467c9cc2e3c (patch) | |
tree | b1724af24b9c583b2780c7a2fe76e76fd174359d /Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/serializer/SolverLanguageSyntacticSequencer.java | |
parent | Update solver language grammar (diff) | |
download | VIATRA-Generator-771e3773bb7ebbf6712724cb2b248467c9cc2e3c.tar.gz VIATRA-Generator-771e3773bb7ebbf6712724cb2b248467c9cc2e3c.tar.zst VIATRA-Generator-771e3773bb7ebbf6712724cb2b248467c9cc2e3c.zip |
Synthetic tokens for solver language
Diffstat (limited to 'Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/serializer/SolverLanguageSyntacticSequencer.java')
-rw-r--r-- | Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/serializer/SolverLanguageSyntacticSequencer.java | 64 |
1 files changed, 26 insertions, 38 deletions
diff --git a/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/serializer/SolverLanguageSyntacticSequencer.java b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/serializer/SolverLanguageSyntacticSequencer.java index 861f2125..1fa1a820 100644 --- a/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/serializer/SolverLanguageSyntacticSequencer.java +++ b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/serializer/SolverLanguageSyntacticSequencer.java | |||
@@ -20,58 +20,46 @@ import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer; | |||
20 | public class SolverLanguageSyntacticSequencer extends AbstractSyntacticSequencer { | 20 | public class SolverLanguageSyntacticSequencer extends AbstractSyntacticSequencer { |
21 | 21 | ||
22 | protected SolverLanguageGrammarAccess grammarAccess; | 22 | protected SolverLanguageGrammarAccess grammarAccess; |
23 | protected AbstractElementAlias match_AtomicExpression_LeftParenthesisKeyword_3_0_a; | 23 | protected AbstractElementAlias match_AtomicExpression_LeftParenthesisKeyword_4_0_a; |
24 | protected AbstractElementAlias match_AtomicExpression_LeftParenthesisKeyword_3_0_p; | 24 | protected AbstractElementAlias match_AtomicExpression_LeftParenthesisKeyword_4_0_p; |
25 | protected AbstractElementAlias match_MemberDefinition_SemicolonKeyword_5_q; | 25 | protected AbstractElementAlias match_MemberDefinition_SemicolonKeyword_5_q; |
26 | 26 | ||
27 | @Inject | 27 | @Inject |
28 | protected void init(IGrammarAccess access) { | 28 | protected void init(IGrammarAccess access) { |
29 | grammarAccess = (SolverLanguageGrammarAccess) access; | 29 | grammarAccess = (SolverLanguageGrammarAccess) access; |
30 | match_AtomicExpression_LeftParenthesisKeyword_3_0_a = new TokenAlias(true, true, grammarAccess.getAtomicExpressionAccess().getLeftParenthesisKeyword_3_0()); | 30 | match_AtomicExpression_LeftParenthesisKeyword_4_0_a = new TokenAlias(true, true, grammarAccess.getAtomicExpressionAccess().getLeftParenthesisKeyword_4_0()); |
31 | match_AtomicExpression_LeftParenthesisKeyword_3_0_p = new TokenAlias(true, false, grammarAccess.getAtomicExpressionAccess().getLeftParenthesisKeyword_3_0()); | 31 | match_AtomicExpression_LeftParenthesisKeyword_4_0_p = new TokenAlias(true, false, grammarAccess.getAtomicExpressionAccess().getLeftParenthesisKeyword_4_0()); |
32 | match_MemberDefinition_SemicolonKeyword_5_q = new TokenAlias(false, true, grammarAccess.getMemberDefinitionAccess().getSemicolonKeyword_5()); | 32 | match_MemberDefinition_SemicolonKeyword_5_q = new TokenAlias(false, true, grammarAccess.getMemberDefinitionAccess().getSemicolonKeyword_5()); |
33 | } | 33 | } |
34 | 34 | ||
35 | @Override | 35 | @Override |
36 | protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) { | 36 | protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) { |
37 | if (ruleCall.getRule() == grammarAccess.getDOTRule()) | 37 | if (ruleCall.getRule() == grammarAccess.getFULL_STOPRule()) |
38 | return getDOTToken(semanticObject, ruleCall, node); | 38 | return getFULL_STOPToken(semanticObject, ruleCall, node); |
39 | else if (ruleCall.getRule() == grammarAccess.getPLUSRule()) | 39 | else if (ruleCall.getRule() == grammarAccess.getREFLEXIVE_TRANSITIVE_CLOSURERule()) |
40 | return getPLUSToken(semanticObject, ruleCall, node); | 40 | return getREFLEXIVE_TRANSITIVE_CLOSUREToken(semanticObject, ruleCall, node); |
41 | else if (ruleCall.getRule() == grammarAccess.getSTARRule()) | 41 | else if (ruleCall.getRule() == grammarAccess.getTRANSITIVE_CLOSURERule()) |
42 | return getSTARToken(semanticObject, ruleCall, node); | 42 | return getTRANSITIVE_CLOSUREToken(semanticObject, ruleCall, node); |
43 | return ""; | 43 | return ""; |
44 | } | 44 | } |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * terminal DOT: | 47 | * Synthetic terminal rule. The concrete syntax is to be specified by clients. |
48 | * "synthetic::dot"; | 48 | * Defaults to the empty string. |
49 | */ | 49 | */ |
50 | protected String getDOTToken(EObject semanticObject, RuleCall ruleCall, INode node) { | 50 | protected String getFULL_STOPToken(EObject semanticObject, RuleCall ruleCall, INode node) { return ""; } |
51 | if (node != null) | ||
52 | return getTokenText(node); | ||
53 | return "synthetic::dot"; | ||
54 | } | ||
55 | 51 | ||
56 | /** | 52 | /** |
57 | * terminal PLUS: | 53 | * Synthetic terminal rule. The concrete syntax is to be specified by clients. |
58 | * "synthetic::plus"; | 54 | * Defaults to the empty string. |
59 | */ | 55 | */ |
60 | protected String getPLUSToken(EObject semanticObject, RuleCall ruleCall, INode node) { | 56 | protected String getREFLEXIVE_TRANSITIVE_CLOSUREToken(EObject semanticObject, RuleCall ruleCall, INode node) { return ""; } |
61 | if (node != null) | ||
62 | return getTokenText(node); | ||
63 | return "synthetic::plus"; | ||
64 | } | ||
65 | 57 | ||
66 | /** | 58 | /** |
67 | * terminal STAR: | 59 | * Synthetic terminal rule. The concrete syntax is to be specified by clients. |
68 | * "synthetic::star"; | 60 | * Defaults to the empty string. |
69 | */ | 61 | */ |
70 | protected String getSTARToken(EObject semanticObject, RuleCall ruleCall, INode node) { | 62 | protected String getTRANSITIVE_CLOSUREToken(EObject semanticObject, RuleCall ruleCall, INode node) { return ""; } |
71 | if (node != null) | ||
72 | return getTokenText(node); | ||
73 | return "synthetic::star"; | ||
74 | } | ||
75 | 63 | ||
76 | @Override | 64 | @Override |
77 | protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) { | 65 | protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) { |
@@ -79,10 +67,10 @@ public class SolverLanguageSyntacticSequencer extends AbstractSyntacticSequencer | |||
79 | List<INode> transitionNodes = collectNodes(fromNode, toNode); | 67 | List<INode> transitionNodes = collectNodes(fromNode, toNode); |
80 | for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) { | 68 | for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) { |
81 | List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax); | 69 | List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax); |
82 | if (match_AtomicExpression_LeftParenthesisKeyword_3_0_a.equals(syntax)) | 70 | if (match_AtomicExpression_LeftParenthesisKeyword_4_0_a.equals(syntax)) |
83 | emit_AtomicExpression_LeftParenthesisKeyword_3_0_a(semanticObject, getLastNavigableState(), syntaxNodes); | 71 | emit_AtomicExpression_LeftParenthesisKeyword_4_0_a(semanticObject, getLastNavigableState(), syntaxNodes); |
84 | else if (match_AtomicExpression_LeftParenthesisKeyword_3_0_p.equals(syntax)) | 72 | else if (match_AtomicExpression_LeftParenthesisKeyword_4_0_p.equals(syntax)) |
85 | emit_AtomicExpression_LeftParenthesisKeyword_3_0_p(semanticObject, getLastNavigableState(), syntaxNodes); | 73 | emit_AtomicExpression_LeftParenthesisKeyword_4_0_p(semanticObject, getLastNavigableState(), syntaxNodes); |
86 | else if (match_MemberDefinition_SemicolonKeyword_5_q.equals(syntax)) | 74 | else if (match_MemberDefinition_SemicolonKeyword_5_q.equals(syntax)) |
87 | emit_MemberDefinition_SemicolonKeyword_5_q(semanticObject, getLastNavigableState(), syntaxNodes); | 75 | emit_MemberDefinition_SemicolonKeyword_5_q(semanticObject, getLastNavigableState(), syntaxNodes); |
88 | else acceptNodes(getLastNavigableState(), syntaxNodes); | 76 | else acceptNodes(getLastNavigableState(), syntaxNodes); |
@@ -99,6 +87,7 @@ public class SolverLanguageSyntacticSequencer extends AbstractSyntacticSequencer | |||
99 | * (rule start) (ambiguity) 'empty' (rule start) | 87 | * (rule start) (ambiguity) 'empty' (rule start) |
100 | * (rule start) (ambiguity) 'if' condition=Expression | 88 | * (rule start) (ambiguity) 'if' condition=Expression |
101 | * (rule start) (ambiguity) 'inf' (rule start) | 89 | * (rule start) (ambiguity) 'inf' (rule start) |
90 | * (rule start) (ambiguity) functor=Reference | ||
102 | * (rule start) (ambiguity) op=AggregationOp | 91 | * (rule start) (ambiguity) op=AggregationOp |
103 | * (rule start) (ambiguity) op=UnaryOp | 92 | * (rule start) (ambiguity) op=UnaryOp |
104 | * (rule start) (ambiguity) referred=[NamedElement|QualifiedName] | 93 | * (rule start) (ambiguity) referred=[NamedElement|QualifiedName] |
@@ -106,13 +95,12 @@ public class SolverLanguageSyntacticSequencer extends AbstractSyntacticSequencer | |||
106 | * (rule start) (ambiguity) value=Real | 95 | * (rule start) (ambiguity) value=Real |
107 | * (rule start) (ambiguity) value=STRING | 96 | * (rule start) (ambiguity) value=STRING |
108 | * (rule start) (ambiguity) {BinaryExpression.left=} | 97 | * (rule start) (ambiguity) {BinaryExpression.left=} |
109 | * (rule start) (ambiguity) {Call.functor=} | ||
110 | * (rule start) (ambiguity) {Comparison.left=} | 98 | * (rule start) (ambiguity) {Comparison.left=} |
111 | * (rule start) (ambiguity) {Conjunction.children+=} | 99 | * (rule start) (ambiguity) {Conjunction.children+=} |
112 | * (rule start) (ambiguity) {Disjunction.children+=} | 100 | * (rule start) (ambiguity) {Disjunction.children+=} |
113 | * (rule start) (ambiguity) {Switch.cases+=} | 101 | * (rule start) (ambiguity) {Switch.cases+=} |
114 | */ | 102 | */ |
115 | protected void emit_AtomicExpression_LeftParenthesisKeyword_3_0_a(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { | 103 | protected void emit_AtomicExpression_LeftParenthesisKeyword_4_0_a(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { |
116 | acceptNodes(transition, nodes); | 104 | acceptNodes(transition, nodes); |
117 | } | 105 | } |
118 | 106 | ||
@@ -131,7 +119,7 @@ public class SolverLanguageSyntacticSequencer extends AbstractSyntacticSequencer | |||
131 | * (rule start) (ambiguity) {Disjunction.children+=} | 119 | * (rule start) (ambiguity) {Disjunction.children+=} |
132 | * (rule start) (ambiguity) {Switch.cases+=} | 120 | * (rule start) (ambiguity) {Switch.cases+=} |
133 | */ | 121 | */ |
134 | protected void emit_AtomicExpression_LeftParenthesisKeyword_3_0_p(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { | 122 | protected void emit_AtomicExpression_LeftParenthesisKeyword_4_0_p(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { |
135 | acceptNodes(transition, nodes); | 123 | acceptNodes(transition, nodes); |
136 | } | 124 | } |
137 | 125 | ||