Browse files

Added SET support for string literals with tests

  • Loading branch information...
1 parent afd39b6 commit 1403781527e8e1c8a02275168fbec99db4b1a3a0 @claco committed Jun 6, 2009
View
6 TT.Tests/TT.Tests.csproj
@@ -64,12 +64,18 @@
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
</ItemGroup>
<ItemGroup>
+ <None Include="templates\GET.implied.variable.output" />
+ <None Include="templates\GET.implied.variable.source" />
<None Include="templates\GET.literal.output" />
<None Include="templates\GET.literal.source" />
<None Include="templates\GET.variable.output" />
<None Include="templates\GET.variable.source" />
<None Include="templates\manual-intro-1.output" />
<None Include="templates\manual-intro-1.source" />
+ <None Include="templates\SET.implied.literal.output" />
+ <None Include="templates\SET.implied.literal.source" />
+ <None Include="templates\SET.literal.output" />
+ <None Include="templates\SET.literal.source" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
View
28 TT.Tests/VariableTests.cs
@@ -24,5 +24,33 @@ public void GetVariable()
Expect(result, Is.EqualTo(Output("GET.variable")));
}
+
+ [Test, Category("Unit")]
+ public void ImpliedGetVariable()
+ {
+ var data = new Dictionary<string, object> { { "variable", "Hello World" } };
+ var result = Template.Process(Source("GET.implied.variable"), data);
+
+ Expect(result, Is.EqualTo(Output("GET.implied.variable")));
+ }
+
+ [Test, Category("Unit")]
+ public void SetLiteralVariable()
+ {
+ var data = new Dictionary<string, object>();
+ var result = Template.Process(Source("SET.literal"), data);
+
+ Expect(result, Is.EqualTo(Output("SET.literal")));
+ Expect(data["variable"], Is.EqualTo("Hello World"));
+ }
+
+ [Test, Category("Unit")]
+ public void ImpliedSetVariable()
+ {
+ var data = new Dictionary<string, object>();
+ var result = Template.Process(Source("SET.implied.literal"), data);
+
+ Expect(result, Is.EqualTo(Output("SET.implied.literal")));
+ }
}
}
View
1 TT.Tests/templates/GET.implied.variable.output
@@ -0,0 +1 @@
+Hello World
View
1 TT.Tests/templates/GET.implied.variable.source
@@ -0,0 +1 @@
+[% variable %]
View
1 TT.Tests/templates/SET.implied.literal.output
@@ -0,0 +1 @@
+
View
1 TT.Tests/templates/SET.implied.literal.source
@@ -0,0 +1 @@
+[% variable = 'Hello World' %]
View
1 TT.Tests/templates/SET.literal.output
@@ -0,0 +1 @@
+
View
1 TT.Tests/templates/SET.literal.source
@@ -0,0 +1 @@
+[% SET variable = 'Hello World' %]
View
234 TT/CSharpGenerator.cs
@@ -1,4 +1,4 @@
-// $ANTLR 3.1.3 Mar 18, 2009 10:09:25 TT\\CSharpGenerator.g 2009-05-30 22:33:02
+// $ANTLR 3.1.3 Mar 18, 2009 10:09:25 TT\\CSharpGenerator.g 2009-06-06 11:23:06
// The variable 'variable' is assigned but its value is never used.
#pragma warning disable 168, 219
@@ -27,6 +27,7 @@ public partial class CSharpGenerator : TreeParser
"<DOWN>",
"<UP>",
"GET",
+ "SET",
"PRINT",
"DOCUMENT",
"WS",
@@ -36,7 +37,6 @@ public partial class CSharpGenerator : TreeParser
"SQUOTE",
"ILITERAL",
"LITERAL",
- "SET",
"CALL",
"DEFAULT",
"INSERT",
@@ -78,7 +78,8 @@ public partial class CSharpGenerator : TreeParser
"ASSIGN",
"EQUAL",
"CHAR",
- "'GET'"
+ "'GET'",
+ "'SET'"
};
public const int WHILE = 23;
@@ -89,14 +90,15 @@ public partial class CSharpGenerator : TreeParser
public const int ID = 45;
public const int EOF = -1;
public const int IF = 24;
- public const int TSTART = 8;
+ public const int TSTART = 9;
public const int T__56 = 56;
public const int FINAL = 38;
- public const int TSTOP = 9;
- public const int QUOTE = 10;
+ public const int T__57 = 57;
+ public const int TSTOP = 10;
+ public const int QUOTE = 11;
public const int INSERT = 17;
public const int COMMENTS = 44;
- public const int DOCUMENT = 6;
+ public const int DOCUMENT = 7;
public const int EQUAL = 54;
public const int INCLUDE = 19;
public const int RETURN = 41;
@@ -105,23 +107,23 @@ public partial class CSharpGenerator : TreeParser
public const int DIGIT = 46;
public const int LAST = 40;
public const int UNLESS = 25;
- public const int ILITERAL = 12;
+ public const int ILITERAL = 13;
public const int ADD = 49;
public const int SWITCH = 28;
public const int DEFAULT = 16;
public const int ELSE = 27;
public const int NUMBER = 47;
public const int TAGS = 43;
- public const int SET = 14;
- public const int LITERAL = 13;
public const int STOP = 42;
+ public const int LITERAL = 14;
+ public const int SET = 5;
public const int MULT = 51;
- public const int SQUOTE = 11;
+ public const int SQUOTE = 12;
public const int WRAPPER = 20;
- public const int PRINT = 5;
+ public const int PRINT = 6;
public const int TRY = 35;
public const int PERL = 33;
- public const int WS = 7;
+ public const int WS = 8;
public const int DECIMAL = 48;
public const int BLOCK = 21;
public const int FILTER = 31;
@@ -221,7 +223,7 @@ public class document_return : TreeRuleReturnScope
int alt1 = 2;
int LA1_0 = input.LA(1);
- if ( (LA1_0 == GET) )
+ if ( ((LA1_0 >= GET && LA1_0 <= SET)) )
{
alt1 = 1;
}
@@ -288,35 +290,78 @@ public class statement_return : TreeRuleReturnScope
};
// $ANTLR start "statement"
- // TT\\CSharpGenerator.g:17:1: statement : getExpr -> {$getExpr.st};
+ // TT\\CSharpGenerator.g:17:1: statement : ( getExpr -> {$getExpr.st} | setExpr -> {$setExpr.st});
public CSharpGenerator.statement_return statement() // throws RecognitionException [1]
{
CSharpGenerator.statement_return retval = new CSharpGenerator.statement_return();
retval.Start = input.LT(1);
CSharpGenerator.getExpr_return getExpr1 = default(CSharpGenerator.getExpr_return);
+ CSharpGenerator.setExpr_return setExpr2 = default(CSharpGenerator.setExpr_return);
+
try
{
- // TT\\CSharpGenerator.g:18:2: ( getExpr -> {$getExpr.st})
- // TT\\CSharpGenerator.g:18:4: getExpr
+ // TT\\CSharpGenerator.g:18:2: ( getExpr -> {$getExpr.st} | setExpr -> {$setExpr.st})
+ int alt2 = 2;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0 == GET) )
+ {
+ alt2 = 1;
+ }
+ else if ( (LA2_0 == SET) )
+ {
+ alt2 = 2;
+ }
+ else
{
- PushFollow(FOLLOW_getExpr_in_statement75);
- getExpr1 = getExpr();
- state.followingStackPointer--;
+ NoViableAltException nvae_d2s0 =
+ new NoViableAltException("", 2, 0, input);
+ throw nvae_d2s0;
+ }
+ switch (alt2)
+ {
+ case 1 :
+ // TT\\CSharpGenerator.g:18:4: getExpr
+ {
+ PushFollow(FOLLOW_getExpr_in_statement75);
+ getExpr1 = getExpr();
+ state.followingStackPointer--;
- // TEMPLATE REWRITE
- // 18:12: -> {$getExpr.st}
- {
- retval.ST = ((getExpr1 != null) ? getExpr1.ST : null);
- }
+
+ // TEMPLATE REWRITE
+ // 18:12: -> {$getExpr.st}
+ {
+ retval.ST = ((getExpr1 != null) ? getExpr1.ST : null);
+ }
- }
+ }
+ break;
+ case 2 :
+ // TT\\CSharpGenerator.g:19:4: setExpr
+ {
+ PushFollow(FOLLOW_setExpr_in_statement84);
+ setExpr2 = setExpr();
+ state.followingStackPointer--;
+
+
+ // TEMPLATE REWRITE
+ // 19:12: -> {$setExpr.st}
+ {
+ retval.ST = ((setExpr2 != null) ? setExpr2.ST : null);
+ }
+
+
+ }
+ break;
+
+ }
}
catch (RecognitionException re)
{
@@ -339,99 +384,99 @@ public class getExpr_return : TreeRuleReturnScope
};
// $ANTLR start "getExpr"
- // TT\\CSharpGenerator.g:21:1: getExpr : ( ^( GET LITERAL ) -> print(literal=$LITERAL.Text.Substring(1, $LITERAL.Text.Length-2).Replace(\"\\r\\n\", \"\\\\r\\\\n\").Replace(\"\\r\", \"\\\\r\").Replace(\"\\n\", \"\\\\n\")) | ^( GET ID ) -> getVariable(name=$ID.text));
+ // TT\\CSharpGenerator.g:22:1: getExpr : ( ^( GET LITERAL ) -> print(literal=$LITERAL.Text.Substring(1, $LITERAL.Text.Length-2).Replace(\"\\r\\n\", \"\\\\r\\\\n\").Replace(\"\\r\", \"\\\\r\").Replace(\"\\n\", \"\\\\n\")) | ^( GET ID ) -> getVariable(name=$ID.text));
public CSharpGenerator.getExpr_return getExpr() // throws RecognitionException [1]
{
CSharpGenerator.getExpr_return retval = new CSharpGenerator.getExpr_return();
retval.Start = input.LT(1);
- CommonTree LITERAL2 = null;
- CommonTree ID3 = null;
+ CommonTree LITERAL3 = null;
+ CommonTree ID4 = null;
try
{
- // TT\\CSharpGenerator.g:22:2: ( ^( GET LITERAL ) -> print(literal=$LITERAL.Text.Substring(1, $LITERAL.Text.Length-2).Replace(\"\\r\\n\", \"\\\\r\\\\n\").Replace(\"\\r\", \"\\\\r\").Replace(\"\\n\", \"\\\\n\")) | ^( GET ID ) -> getVariable(name=$ID.text))
- int alt2 = 2;
- int LA2_0 = input.LA(1);
+ // TT\\CSharpGenerator.g:23:2: ( ^( GET LITERAL ) -> print(literal=$LITERAL.Text.Substring(1, $LITERAL.Text.Length-2).Replace(\"\\r\\n\", \"\\\\r\\\\n\").Replace(\"\\r\", \"\\\\r\").Replace(\"\\n\", \"\\\\n\")) | ^( GET ID ) -> getVariable(name=$ID.text))
+ int alt3 = 2;
+ int LA3_0 = input.LA(1);
- if ( (LA2_0 == GET) )
+ if ( (LA3_0 == GET) )
{
- int LA2_1 = input.LA(2);
+ int LA3_1 = input.LA(2);
- if ( (LA2_1 == DOWN) )
+ if ( (LA3_1 == DOWN) )
{
- int LA2_2 = input.LA(3);
+ int LA3_2 = input.LA(3);
- if ( (LA2_2 == LITERAL) )
+ if ( (LA3_2 == LITERAL) )
{
- alt2 = 1;
+ alt3 = 1;
}
- else if ( (LA2_2 == ID) )
+ else if ( (LA3_2 == ID) )
{
- alt2 = 2;
+ alt3 = 2;
}
else
{
- NoViableAltException nvae_d2s2 =
- new NoViableAltException("", 2, 2, input);
+ NoViableAltException nvae_d3s2 =
+ new NoViableAltException("", 3, 2, input);
- throw nvae_d2s2;
+ throw nvae_d3s2;
}
}
else
{
- NoViableAltException nvae_d2s1 =
- new NoViableAltException("", 2, 1, input);
+ NoViableAltException nvae_d3s1 =
+ new NoViableAltException("", 3, 1, input);
- throw nvae_d2s1;
+ throw nvae_d3s1;
}
}
else
{
- NoViableAltException nvae_d2s0 =
- new NoViableAltException("", 2, 0, input);
+ NoViableAltException nvae_d3s0 =
+ new NoViableAltException("", 3, 0, input);
- throw nvae_d2s0;
+ throw nvae_d3s0;
}
- switch (alt2)
+ switch (alt3)
{
case 1 :
- // TT\\CSharpGenerator.g:22:4: ^( GET LITERAL )
+ // TT\\CSharpGenerator.g:23:4: ^( GET LITERAL )
{
- Match(input,GET,FOLLOW_GET_in_getExpr91);
+ Match(input,GET,FOLLOW_GET_in_getExpr100);
Match(input, Token.DOWN, null);
- LITERAL2=(CommonTree)Match(input,LITERAL,FOLLOW_LITERAL_in_getExpr93);
+ LITERAL3=(CommonTree)Match(input,LITERAL,FOLLOW_LITERAL_in_getExpr102);
Match(input, Token.UP, null);
// TEMPLATE REWRITE
- // 22:19: -> print(literal=$LITERAL.Text.Substring(1, $LITERAL.Text.Length-2).Replace(\"\\r\\n\", \"\\\\r\\\\n\").Replace(\"\\r\", \"\\\\r\").Replace(\"\\n\", \"\\\\n\"))
+ // 23:19: -> print(literal=$LITERAL.Text.Substring(1, $LITERAL.Text.Length-2).Replace(\"\\r\\n\", \"\\\\r\\\\n\").Replace(\"\\r\", \"\\\\r\").Replace(\"\\n\", \"\\\\n\"))
{
retval.ST = templateLib.GetInstanceOf("print",
- new STAttrMap().Add("literal", LITERAL2.Text.Substring(1, LITERAL2.Text.Length-2).Replace("\r\n", "\\r\\n").Replace("\r", "\\r").Replace("\n", "\\n")));
+ new STAttrMap().Add("literal", LITERAL3.Text.Substring(1, LITERAL3.Text.Length-2).Replace("\r\n", "\\r\\n").Replace("\r", "\\r").Replace("\n", "\\n")));
}
}
break;
case 2 :
- // TT\\CSharpGenerator.g:23:4: ^( GET ID )
+ // TT\\CSharpGenerator.g:24:4: ^( GET ID )
{
- Match(input,GET,FOLLOW_GET_in_getExpr109);
+ Match(input,GET,FOLLOW_GET_in_getExpr118);
Match(input, Token.DOWN, null);
- ID3=(CommonTree)Match(input,ID,FOLLOW_ID_in_getExpr111);
+ ID4=(CommonTree)Match(input,ID,FOLLOW_ID_in_getExpr120);
Match(input, Token.UP, null);
// TEMPLATE REWRITE
- // 23:14: -> getVariable(name=$ID.text)
+ // 24:14: -> getVariable(name=$ID.text)
{
retval.ST = templateLib.GetInstanceOf("getVariable",
- new STAttrMap().Add("name", ((ID3 != null) ? ID3.Text : null)));
+ new STAttrMap().Add("name", ((ID4 != null) ? ID4.Text : null)));
}
@@ -452,6 +497,61 @@ public class getExpr_return : TreeRuleReturnScope
}
// $ANTLR end "getExpr"
+ public class setExpr_return : TreeRuleReturnScope
+ {
+ private StringTemplate st;
+ public StringTemplate ST { get { return st; } set { st = value; } }
+ public override object Template { get { return st; } }
+ public override string ToString() { return (st == null) ? null : st.ToString(); }
+ };
+
+ // $ANTLR start "setExpr"
+ // TT\\CSharpGenerator.g:27:1: setExpr : ^( SET ID LITERAL ) -> setVariable(name=$ID.textliteral=$LITERAL.Text.Substring(1, $LITERAL.Text.Length-2).Replace(\"\\r\\n\", \"\\\\r\\\\n\").Replace(\"\\r\", \"\\\\r\").Replace(\"\\n\", \"\\\\n\"));
+ public CSharpGenerator.setExpr_return setExpr() // throws RecognitionException [1]
+ {
+ CSharpGenerator.setExpr_return retval = new CSharpGenerator.setExpr_return();
+ retval.Start = input.LT(1);
+
+ CommonTree ID5 = null;
+ CommonTree LITERAL6 = null;
+
+ try
+ {
+ // TT\\CSharpGenerator.g:28:2: ( ^( SET ID LITERAL ) -> setVariable(name=$ID.textliteral=$LITERAL.Text.Substring(1, $LITERAL.Text.Length-2).Replace(\"\\r\\n\", \"\\\\r\\\\n\").Replace(\"\\r\", \"\\\\r\").Replace(\"\\n\", \"\\\\n\")))
+ // TT\\CSharpGenerator.g:28:4: ^( SET ID LITERAL )
+ {
+ Match(input,SET,FOLLOW_SET_in_setExpr142);
+
+ Match(input, Token.DOWN, null);
+ ID5=(CommonTree)Match(input,ID,FOLLOW_ID_in_setExpr144);
+ LITERAL6=(CommonTree)Match(input,LITERAL,FOLLOW_LITERAL_in_setExpr146);
+
+ Match(input, Token.UP, null);
+
+
+ // TEMPLATE REWRITE
+ // 28:22: -> setVariable(name=$ID.textliteral=$LITERAL.Text.Substring(1, $LITERAL.Text.Length-2).Replace(\"\\r\\n\", \"\\\\r\\\\n\").Replace(\"\\r\", \"\\\\r\").Replace(\"\\n\", \"\\\\n\"))
+ {
+ retval.ST = templateLib.GetInstanceOf("setVariable",
+ new STAttrMap().Add("name", ((ID5 != null) ? ID5.Text : null)).Add("literal", LITERAL6.Text.Substring(1, LITERAL6.Text.Length-2).Replace("\r\n", "\\r\\n").Replace("\r", "\\r").Replace("\n", "\\n")));
+ }
+
+
+ }
+
+ }
+ catch (RecognitionException re)
+ {
+ ReportError(re);
+ Recover(input,re);
+ }
+ finally
+ {
+ }
+ return retval;
+ }
+ // $ANTLR end "setExpr"
+
// Delegated rules
@@ -462,12 +562,16 @@ private void InitializeCyclicDFAs()
public static readonly BitSet FOLLOW_DOCUMENT_in_document49 = new BitSet(new ulong[]{0x0000000000000004UL});
- public static readonly BitSet FOLLOW_statement_in_document53 = new BitSet(new ulong[]{0x0000000000000018UL});
+ public static readonly BitSet FOLLOW_statement_in_document53 = new BitSet(new ulong[]{0x0000000000000038UL});
public static readonly BitSet FOLLOW_getExpr_in_statement75 = new BitSet(new ulong[]{0x0000000000000002UL});
- public static readonly BitSet FOLLOW_GET_in_getExpr91 = new BitSet(new ulong[]{0x0000000000000004UL});
- public static readonly BitSet FOLLOW_LITERAL_in_getExpr93 = new BitSet(new ulong[]{0x0000000000000008UL});
- public static readonly BitSet FOLLOW_GET_in_getExpr109 = new BitSet(new ulong[]{0x0000000000000004UL});
- public static readonly BitSet FOLLOW_ID_in_getExpr111 = new BitSet(new ulong[]{0x0000000000000008UL});
+ public static readonly BitSet FOLLOW_setExpr_in_statement84 = new BitSet(new ulong[]{0x0000000000000002UL});
+ public static readonly BitSet FOLLOW_GET_in_getExpr100 = new BitSet(new ulong[]{0x0000000000000004UL});
+ public static readonly BitSet FOLLOW_LITERAL_in_getExpr102 = new BitSet(new ulong[]{0x0000000000000008UL});
+ public static readonly BitSet FOLLOW_GET_in_getExpr118 = new BitSet(new ulong[]{0x0000000000000004UL});
+ public static readonly BitSet FOLLOW_ID_in_getExpr120 = new BitSet(new ulong[]{0x0000000000000008UL});
+ public static readonly BitSet FOLLOW_SET_in_setExpr142 = new BitSet(new ulong[]{0x0000000000000004UL});
+ public static readonly BitSet FOLLOW_ID_in_setExpr144 = new BitSet(new ulong[]{0x0000000000004000UL});
+ public static readonly BitSet FOLLOW_LITERAL_in_setExpr146 = new BitSet(new ulong[]{0x0000000000000008UL});
}
}
View
5 TT/CSharpGenerator.g
@@ -16,9 +16,14 @@ document
statement
: getExpr -> {$getExpr.st}
+ | setExpr -> {$setExpr.st}
;
getExpr
: ^(GET LITERAL) -> print(literal={$LITERAL.Text.Substring(1, $LITERAL.Text.Length-2).Replace("\r\n", "\\r\\n").Replace("\r", "\\r").Replace("\n", "\\n")})
| ^(GET ID) -> getVariable(name={$ID.text})
;
+
+setExpr
+ : ^(SET ID LITERAL) -> setVariable(name={$ID.text}, literal={$LITERAL.Text.Substring(1, $LITERAL.Text.Length-2).Replace("\r\n", "\\r\\n").Replace("\r", "\\r").Replace("\n", "\\n")})
+ ;
View
12 TT/CSharpGenerator.stg
@@ -39,6 +39,14 @@ class(statements) ::= <<
return null;
}
+
+ public void SetVariable(string name, string value) {
+ if (name != null) {
+ if (_variables != null) {
+ _variables[name] = value;
+ };
+ };
+ }
}
>>
@@ -48,4 +56,8 @@ Print(Literal("<literal>"));<\n>
getVariable(name) ::= <<
Print(GetVariable("<name>").ToString());<\n>
+>>
+
+setVariable(name, literal) ::= <<
+SetVariable("<name>", "<literal>");
>>
View
22 TT/CSharpGenerator.tokens
@@ -5,14 +5,15 @@ RAWPERL=34
SUB=50
ID=45
IF=24
-TSTART=8
+TSTART=9
T__56=56
FINAL=38
-TSTOP=9
-QUOTE=10
+T__57=57
+TSTOP=10
+QUOTE=11
INSERT=17
COMMENTS=44
-DOCUMENT=6
+DOCUMENT=7
EQUAL=54
INCLUDE=19
RETURN=41
@@ -21,23 +22,23 @@ NEXT=39
DIGIT=46
LAST=40
UNLESS=25
-ILITERAL=12
+ILITERAL=13
ADD=49
SWITCH=28
DEFAULT=16
ELSE=27
NUMBER=47
TAGS=43
-SET=14
-LITERAL=13
STOP=42
+LITERAL=14
+SET=5
MULT=51
-SQUOTE=11
+SQUOTE=12
WRAPPER=20
-PRINT=5
+PRINT=6
TRY=35
PERL=33
-WS=7
+WS=8
DECIMAL=48
BLOCK=21
FILTER=31
@@ -52,3 +53,4 @@ PROCESS=18
MACRO=30
THROW=36
'GET'=56
+'SET'=57
View
4 TT/Template.g
@@ -9,6 +9,7 @@ options
tokens {
GET;
+ SET;
PRINT;
DOCUMENT;
}
@@ -24,7 +25,6 @@ QUOTE : '"';
SQUOTE : '\'';
ILITERAL: QUOTE .* QUOTE;
LITERAL : SQUOTE .* SQUOTE;
-SET : 'SET';
CALL : 'CALL';
DEFAULT : 'DEFAULT';
INSERT : 'INSERT';
@@ -90,5 +90,5 @@ getExpr
;
setExpr
- : SET? ID ASSIGN (ID|LITERAL|ILITERAL|NUMBER|DECIMAL)
+ : 'SET'? ID ASSIGN LITERAL -> ^(SET ID LITERAL)
;
View
22 TT/Template.tokens
@@ -4,15 +4,16 @@ CHAR=55
RAWPERL=34
SUB=50
ID=45
-TSTART=8
+TSTART=9
IF=24
T__56=56
-QUOTE=10
-TSTOP=9
+QUOTE=11
+TSTOP=10
+T__57=57
FINAL=38
COMMENTS=44
INSERT=17
-DOCUMENT=6
+DOCUMENT=7
EQUAL=54
INCLUDE=19
RETURN=41
@@ -21,23 +22,23 @@ NEXT=39
DIGIT=46
LAST=40
UNLESS=25
-ILITERAL=12
+ILITERAL=13
ADD=49
SWITCH=28
DEFAULT=16
ELSE=27
NUMBER=47
TAGS=43
-SET=14
-LITERAL=13
STOP=42
+LITERAL=14
+SET=5
MULT=51
-SQUOTE=11
+SQUOTE=12
WRAPPER=20
-PRINT=5
+PRINT=6
TRY=35
PERL=33
-WS=7
+WS=8
DECIMAL=48
BLOCK=21
ASSIGN=53
@@ -52,3 +53,4 @@ CATCH=37
MACRO=30
THROW=36
'GET'=56
+'SET'=57
View
396 TT/TemplateLexer.cs
@@ -1,4 +1,4 @@
-// $ANTLR 3.1.3 Mar 18, 2009 10:09:25 TT\\Template.g 2009-05-30 22:33:01
+// $ANTLR 3.1.3 Mar 18, 2009 10:09:25 TT\\Template.g 2009-06-06 11:23:04
// The variable 'variable' is assigned but its value is never used.
#pragma warning disable 168, 219
@@ -24,14 +24,15 @@ public partial class TemplateLexer : Lexer {
public const int ID = 45;
public const int EOF = -1;
public const int IF = 24;
- public const int TSTART = 8;
+ public const int TSTART = 9;
public const int T__56 = 56;
public const int FINAL = 38;
- public const int TSTOP = 9;
- public const int QUOTE = 10;
+ public const int T__57 = 57;
+ public const int TSTOP = 10;
+ public const int QUOTE = 11;
public const int INSERT = 17;
public const int COMMENTS = 44;
- public const int DOCUMENT = 6;
+ public const int DOCUMENT = 7;
public const int EQUAL = 54;
public const int INCLUDE = 19;
public const int RETURN = 41;
@@ -40,23 +41,23 @@ public partial class TemplateLexer : Lexer {
public const int DIGIT = 46;
public const int LAST = 40;
public const int UNLESS = 25;
- public const int ILITERAL = 12;
+ public const int ILITERAL = 13;
public const int ADD = 49;
public const int SWITCH = 28;
public const int DEFAULT = 16;
public const int ELSE = 27;
public const int NUMBER = 47;
public const int TAGS = 43;
- public const int SET = 14;
- public const int LITERAL = 13;
public const int STOP = 42;
+ public const int LITERAL = 14;
+ public const int SET = 5;
public const int MULT = 51;
- public const int SQUOTE = 11;
+ public const int SQUOTE = 12;
public const int WRAPPER = 20;
- public const int PRINT = 5;
+ public const int PRINT = 6;
public const int TRY = 35;
public const int PERL = 33;
- public const int WS = 7;
+ public const int WS = 8;
public const int DECIMAL = 48;
public const int BLOCK = 21;
public const int FILTER = 31;
@@ -116,19 +117,43 @@ override public string GrammarFileName
}
// $ANTLR end "T__56"
+ // $ANTLR start "T__57"
+ public void mT__57() // throws RecognitionException [2]
+ {
+ try
+ {
+ int _type = T__57;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // TT\\Template.g:10:7: ( 'SET' )
+ // TT\\Template.g:10:9: 'SET'
+ {
+ Match("SET");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally
+ {
+ }
+ }
+ // $ANTLR end "T__57"
+
// $ANTLR start "TSTART"
public void mTSTART() // throws RecognitionException [2]
{
try
{
int _type = TSTART;
int _channel = DEFAULT_TOKEN_CHANNEL;
- // TT\\Template.g:20:8: ( '[%' ( WS )? )
- // TT\\Template.g:20:10: '[%' ( WS )?
+ // TT\\Template.g:21:8: ( '[%' ( WS )? )
+ // TT\\Template.g:21:10: '[%' ( WS )?
{
Match("[%");
- // TT\\Template.g:20:15: ( WS )?
+ // TT\\Template.g:21:15: ( WS )?
int alt1 = 2;
int LA1_0 = input.LA(1);
@@ -139,7 +164,7 @@ override public string GrammarFileName
switch (alt1)
{
case 1 :
- // TT\\Template.g:20:15: WS
+ // TT\\Template.g:21:15: WS
{
mWS();
@@ -167,10 +192,10 @@ override public string GrammarFileName
{
int _type = TSTOP;
int _channel = DEFAULT_TOKEN_CHANNEL;
- // TT\\Template.g:21:7: ( ( WS )? '%]' )
- // TT\\Template.g:21:9: ( WS )? '%]'
+ // TT\\Template.g:22:7: ( ( WS )? '%]' )
+ // TT\\Template.g:22:9: ( WS )? '%]'
{
- // TT\\Template.g:21:9: ( WS )?
+ // TT\\Template.g:22:9: ( WS )?
int alt2 = 2;
int LA2_0 = input.LA(1);
@@ -181,7 +206,7 @@ override public string GrammarFileName
switch (alt2)
{
case 1 :
- // TT\\Template.g:21:9: WS
+ // TT\\Template.g:22:9: WS
{
mWS();
@@ -211,10 +236,10 @@ override public string GrammarFileName
{
int _type = WS;
int _channel = DEFAULT_TOKEN_CHANNEL;
- // TT\\Template.g:22:4: ( ( '\\r' | '\\n' | '\\t' | ' ' )+ )
- // TT\\Template.g:22:6: ( '\\r' | '\\n' | '\\t' | ' ' )+
+ // TT\\Template.g:23:4: ( ( '\\r' | '\\n' | '\\t' | ' ' )+ )
+ // TT\\Template.g:23:6: ( '\\r' | '\\n' | '\\t' | ' ' )+
{
- // TT\\Template.g:22:6: ( '\\r' | '\\n' | '\\t' | ' ' )+
+ // TT\\Template.g:23:6: ( '\\r' | '\\n' | '\\t' | ' ' )+
int cnt3 = 0;
do
{
@@ -279,8 +304,8 @@ override public string GrammarFileName
{
int _type = QUOTE;
int _channel = DEFAULT_TOKEN_CHANNEL;
- // TT\\Template.g:23:7: ( '\"' )
- // TT\\Template.g:23:9: '\"'
+ // TT\\Template.g:24:7: ( '\"' )
+ // TT\\Template.g:24:9: '\"'
{
Match('\"');
@@ -302,8 +327,8 @@ override public string GrammarFileName
{
int _type = SQUOTE;
int _channel = DEFAULT_TOKEN_CHANNEL;
- // TT\\Template.g:24:8: ( '\\'' )
- // TT\\Template.g:24:10: '\\''
+ // TT\\Template.g:25:8: ( '\\'' )
+ // TT\\Template.g:25:10: '\\''
{
Match('\'');
@@ -325,11 +350,11 @@ override public string GrammarFileName
{
int _type = ILITERAL;
int _channel = DEFAULT_TOKEN_CHANNEL;
- // TT\\Template.g:25:9: ( QUOTE ( . )* QUOTE )
- // TT\\Template.g:25:11: QUOTE ( . )* QUOTE
+ // TT\\Template.g:26:9: ( QUOTE ( . )* QUOTE )
+ // TT\\Template.g:26:11: QUOTE ( . )* QUOTE
{
mQUOTE();
- // TT\\Template.g:25:17: ( . )*
+ // TT\\Template.g:26:17: ( . )*
do
{
int alt4 = 2;
@@ -348,7 +373,7 @@ override public string GrammarFileName
switch (alt4)
{
case 1 :
- // TT\\Template.g:25:17: .
+ // TT\\Template.g:26:17: .
{
MatchAny();
@@ -383,11 +408,11 @@ override public string GrammarFileName
{
int _type = LITERAL;
int _channel = DEFAULT_TOKEN_CHANNEL;
- // TT\\Template.g:26:9: ( SQUOTE ( . )* SQUOTE )
- // TT\\Template.g:26:11: SQUOTE ( . )* SQUOTE
+ // TT\\Template.g:27:9: ( SQUOTE ( . )* SQUOTE )
+ // TT\\Template.g:27:11: SQUOTE ( . )* SQUOTE
{
mSQUOTE();
- // TT\\Template.g:26:18: ( . )*
+ // TT\\Template.g:27:18: ( . )*
do
{
int alt5 = 2;
@@ -406,7 +431,7 @@ override public string GrammarFileName
switch (alt5)
{
case 1 :
- // TT\\Template.g:26:18: .
+ // TT\\Template.g:27:18: .
{
MatchAny();
@@ -434,30 +459,6 @@ override public string GrammarFileName
}
// $ANTLR end "LITERAL"
- // $ANTLR start "SET"
- public void mSET() // throws RecognitionException [2]
- {
- try
- {
- int _type = SET;
- int _channel = DEFAULT_TOKEN_CHANNEL;
- // TT\\Template.g:27:5: ( 'SET' )
- // TT\\Template.g:27:7: 'SET'
- {
- Match("SET");
-
-
- }
-
- state.type = _type;
- state.channel = _channel;
- }
- finally
- {
- }
- }
- // $ANTLR end "SET"
-
// $ANTLR start "CALL"
public void mCALL() // throws RecognitionException [2]
{
@@ -1532,7 +1533,7 @@ override public string GrammarFileName
override public void mTokens() // throws RecognitionException
{
- // TT\\Template.g:1:8: ( T__56 | TSTART | TSTOP | WS | QUOTE | SQUOTE | ILITERAL | LITERAL | SET | CALL | DEFAULT | INSERT | PROCESS | INCLUDE | WRAPPER | BLOCK | FOREACH | WHILE | IF | UNLESS | ELSIF | ELSE | SWITCH | CASE | MACRO | FILTER | USE | PERL | RAWPERL | TRY | THROW | CATCH | FINAL | NEXT | LAST | RETURN | STOP | TAGS | COMMENTS | ID | DIGIT | NUMBER | DECIMAL | ADD | SUB | MULT | DIV | ASSIGN | EQUAL | CHAR )
+ // TT\\Template.g:1:8: ( T__56 | T__57 | TSTART | TSTOP | WS | QUOTE | SQUOTE | ILITERAL | LITERAL | CALL | DEFAULT | INSERT | PROCESS | INCLUDE | WRAPPER | BLOCK | FOREACH | WHILE | IF | UNLESS | ELSIF | ELSE | SWITCH | CASE | MACRO | FILTER | USE | PERL | RAWPERL | TRY | THROW | CATCH | FINAL | NEXT | LAST | RETURN | STOP | TAGS | COMMENTS | ID | DIGIT | NUMBER | DECIMAL | ADD | SUB | MULT | DIV | ASSIGN | EQUAL | CHAR )
int alt8 = 50;
alt8 = dfa8.Predict(input);
switch (alt8)
@@ -1545,343 +1546,343 @@ override public string GrammarFileName
}
break;
case 2 :
- // TT\\Template.g:1:16: TSTART
+ // TT\\Template.g:1:16: T__57
{
- mTSTART();
+ mT__57();
}
break;
case 3 :
- // TT\\Template.g:1:23: TSTOP
+ // TT\\Template.g:1:22: TSTART
{
- mTSTOP();
+ mTSTART();
}
break;
case 4 :
- // TT\\Template.g:1:29: WS
+ // TT\\Template.g:1:29: TSTOP
{
- mWS();
+ mTSTOP();
}
break;
case 5 :
- // TT\\Template.g:1:32: QUOTE
+ // TT\\Template.g:1:35: WS
{
- mQUOTE();
+ mWS();
}
break;
case 6 :
- // TT\\Template.g:1:38: SQUOTE
+ // TT\\Template.g:1:38: QUOTE
{
- mSQUOTE();
+ mQUOTE();
}
break;
case 7 :
- // TT\\Template.g:1:45: ILITERAL
+ // TT\\Template.g:1:44: SQUOTE
{
- mILITERAL();
+ mSQUOTE();
}
break;
case 8 :
- // TT\\Template.g:1:54: LITERAL
+ // TT\\Template.g:1:51: ILITERAL
{
- mLITERAL();
+ mILITERAL();
}
break;
case 9 :
- // TT\\Template.g:1:62: SET
+ // TT\\Template.g:1:60: LITERAL
{
- mSET();
+ mLITERAL();
}
break;
case 10 :
- // TT\\Template.g:1:66: CALL
+ // TT\\Template.g:1:68: CALL
{
mCALL();
}
break;
case 11 :
- // TT\\Template.g:1:71: DEFAULT
+ // TT\\Template.g:1:73: DEFAULT
{
mDEFAULT();
}
break;
case 12 :
- // TT\\Template.g:1:79: INSERT
+ // TT\\Template.g:1:81: INSERT
{
mINSERT();
}
break;
case 13 :
- // TT\\Template.g:1:86: PROCESS
+ // TT\\Template.g:1:88: PROCESS
{
mPROCESS();
}
break;
case 14 :
- // TT\\Template.g:1:94: INCLUDE
+ // TT\\Template.g:1:96: INCLUDE
{
mINCLUDE();
}
break;
case 15 :
- // TT\\Template.g:1:102: WRAPPER
+ // TT\\Template.g:1:104: WRAPPER
{
mWRAPPER();
}
break;
case 16 :
- // TT\\Template.g:1:110: BLOCK
+ // TT\\Template.g:1:112: BLOCK
{
mBLOCK();
}
break;
case 17 :
- // TT\\Template.g:1:116: FOREACH
+ // TT\\Template.g:1:118: FOREACH
{
mFOREACH();
}
break;
case 18 :
- // TT\\Template.g:1:124: WHILE
+ // TT\\Template.g:1:126: WHILE
{
mWHILE();
}
break;
case 19 :
- // TT\\Template.g:1:130: IF
+ // TT\\Template.g:1:132: IF
{
mIF();
}
break;
case 20 :
- // TT\\Template.g:1:133: UNLESS
+ // TT\\Template.g:1:135: UNLESS
{
mUNLESS();
}
break;
case 21 :
- // TT\\Template.g:1:140: ELSIF
+ // TT\\Template.g:1:142: ELSIF
{
mELSIF();
}
break;
case 22 :
- // TT\\Template.g:1:146: ELSE
+ // TT\\Template.g:1:148: ELSE
{
mELSE();
}
break;
case 23 :
- // TT\\Template.g:1:151: SWITCH
+ // TT\\Template.g:1:153: SWITCH
{
mSWITCH();
}
break;
case 24 :
- // TT\\Template.g:1:158: CASE
+ // TT\\Template.g:1:160: CASE
{
mCASE();
}
break;
case 25 :
- // TT\\Template.g:1:163: MACRO
+ // TT\\Template.g:1:165: MACRO
{
mMACRO();
}
break;
case 26 :
- // TT\\Template.g:1:169: FILTER
+ // TT\\Template.g:1:171: FILTER
{
mFILTER();
}
break;
case 27 :
- // TT\\Template.g:1:176: USE
+ // TT\\Template.g:1:178: USE
{
mUSE();
}
break;
case 28 :
- // TT\\Template.g:1:180: PERL
+ // TT\\Template.g:1:182: PERL
{
mPERL();
}
break;
case 29 :
- // TT\\Template.g:1:185: RAWPERL
+ // TT\\Template.g:1:187: RAWPERL
{
mRAWPERL();
}
break;
case 30 :
- // TT\\Template.g:1:193: TRY
+ // TT\\Template.g:1:195: TRY
{
mTRY();
}
break;
case 31 :
- // TT\\Template.g:1:197: THROW
+ // TT\\Template.g:1:199: THROW
{
mTHROW();
}
break;
case 32 :
- // TT\\Template.g:1:203: CATCH
+ // TT\\Template.g:1:205: CATCH
{
mCATCH();
}
break;
case 33 :
- // TT\\Template.g:1:209: FINAL
+ // TT\\Template.g:1:211: FINAL
{
mFINAL();
}
break;
case 34 :
- // TT\\Template.g:1:215: NEXT
+ // TT\\Template.g:1:217: NEXT
{
mNEXT();
}
break;
case 35 :
- // TT\\Template.g:1:220: LAST
+ // TT\\Template.g:1:222: LAST
{
mLAST();
}
break;
case 36 :
- // TT\\Template.g:1:225: RETURN
+ // TT\\Template.g:1:227: RETURN
{
mRETURN();
}
break;
case 37 :
- // TT\\Template.g:1:232: STOP
+ // TT\\Template.g:1:234: STOP
{
mSTOP();
}
break;
case 38 :
- // TT\\Template.g:1:237: TAGS
+ // TT\\Template.g:1:239: TAGS
{
mTAGS();
}
break;
case 39 :
- // TT\\Template.g:1:242: COMMENTS
+ // TT\\Template.g:1:244: COMMENTS
{
mCOMMENTS();
}
break;
case 40 :
- // TT\\Template.g:1:251: ID
+ // TT\\Template.g:1:253: ID
{
mID();
}
break;
case 41 :
- // TT\\Template.g:1:254: DIGIT
+ // TT\\Template.g:1:256: DIGIT
{
mDIGIT();
}
break;
case 42 :
- // TT\\Template.g:1:260: NUMBER
+ // TT\\Template.g:1:262: NUMBER
{
mNUMBER();
}
break;
case 43 :
- // TT\\Template.g:1:267: DECIMAL
+ // TT\\Template.g:1:269: DECIMAL
{
mDECIMAL();
}
break;
case 44 :
- // TT\\Template.g:1:275: ADD
+ // TT\\Template.g:1:277: ADD
{
mADD();
}
break;
case 45 :
- // TT\\Template.g:1:279: SUB
+ // TT\\Template.g:1:281: SUB
{
mSUB();
}
break;
case 46 :
- // TT\\Template.g:1:283: MULT
+ // TT\\Template.g:1:285: MULT
{
mMULT();
}
break;
case 47 :
- // TT\\Template.g:1:288: DIV
+ // TT\\Template.g:1:290: DIV
{
mDIV();
}
break;
case 48 :
- // TT\\Template.g:1:292: ASSIGN
+ // TT\\Template.g:1:294: ASSIGN
{
mASSIGN();
}
break;
case 49 :
- // TT\\Template.g:1:299: EQUAL
+ // TT\\Template.g:1:301: EQUAL
{
mEQUAL();
}
break;
case 50 :
- // TT\\Template.g:1:305: CHAR
+ // TT\\Template.g:1:307: CHAR
{
mCHAR();
@@ -1901,26 +1902,26 @@ private void InitializeCyclicDFAs()
}
const string DFA8_eotS =
- "\x01\uffff\x01\x1f\x01\x1d\x01\x21\x01\x1d\x01\x24\x01\x26\x0f"+
- "\x1f\x01\uffff\x01\x42\x04\uffff\x01\x4a\x01\uffff\x01\x1f\x03\uffff"+
- "\x01\x21\x05\uffff\x07\x1f\x01\x56\x12\x1f\x09\uffff\x01\x6a\x01"+
- "\x6b\x09\x1f\x01\uffff\x09\x1f\x01\x7e\x04\x1f\x01\u0084\x04\x1f"+
- "\x02\uffff\x01\x1f\x01\u008a\x01\u008b\x01\u008c\x06\x1f\x01\u0093"+
- "\x07\x1f\x01\uffff\x01\x1f\x01\u009c\x03\x1f\x01\uffff\x01\x1f\x01"+
- "\u00a1\x01\u00a2\x01\u00a3\x01\x1f\x03\uffff\x01\u00a5\x05\x1f\x01"+
- "\uffff\x01\x1f\x01\u00ac\x01\u00ad\x02\x1f\x01\u00b0\x01\x1f\x01"+
- "\u00b2\x01\uffff\x01\u00b3\x02\x1f\x01\u00b6\x03\uffff\x01\u00b7"+
- "\x01\uffff\x02\x1f\x01\u00ba\x03\x1f\x02\uffff\x01\x1f\x01\u00bf"+
- "\x01\uffff\x01\u00c0\x02\uffff\x01\x1f\x01\u00c2\x02\uffff\x01\x1f"+
- "\x01\u00c4\x01\uffff\x01\u00c5\x01\u00c6\x01\u00c7\x01\u00c8\x02"+
- "\uffff\x01\u00c9\x01\uffff\x01\u00ca\x07\uffff";
+ "\x01\uffff\x02\x1f\x01\x1d\x01\x24\x01\x1d\x01\x27\x01\x29\x0e"+
+ "\x1f\x01\uffff\x01\x42\x04\uffff\x01\x4a\x01\uffff\x01\x1f\x01\uffff"+
+ "\x03\x1f\x02\uffff\x01\x24\x05\uffff\x04\x1f\x01\x56\x12\x1f\x09"+
+ "\uffff\x01\x6a\x01\x6b\x09\x1f\x01\uffff\x09\x1f\x01\x7e\x04\x1f"+
+ "\x01\u0084\x04\x1f\x02\uffff\x01\x1f\x01\u008a\x01\u008b\x01\u008c"+
+ "\x06\x1f\x01\u0093\x07\x1f\x01\uffff\x01\x1f\x01\u009c\x03\x1f\x01"+
+ "\uffff\x01\x1f\x01\u00a1\x01\u00a2\x01\u00a3\x01\x1f\x03\uffff\x01"+
+ "\u00a5\x05\x1f\x01\uffff\x01\x1f\x01\u00ac\x01\u00ad\x02\x1f\x01"+
+ "\u00b0\x01\x1f\x01\u00b2\x01\uffff\x01\u00b3\x02\x1f\x01\u00b6\x03"+
+ "\uffff\x01\u00b7\x01\uffff\x02\x1f\x01\u00ba\x03\x1f\x02\uffff\x01"+
+ "\x1f\x01\u00bf\x01\uffff\x01\u00c0\x02\uffff\x01\x1f\x01\u00c2\x02"+
+ "\uffff\x01\x1f\x01\u00c4\x01\uffff\x01\u00c5\x01\u00c6\x01\u00c7"+
+ "\x01\u00c8\x02\uffff\x01\u00c9\x01\uffff\x01\u00ca\x07\uffff";
const string DFA8_eofS =
"\u00cb\uffff";
const string DFA8_minS =
- "\x01\x00\x01\x45\x01\x25\x01\x09\x01\x5d\x02\x00\x01\x45\x01\x41"+
- "\x01\x45\x01\x46\x01\x45\x01\x48\x01\x4c\x01\x49\x01\x4e\x01\x4c"+
- "\x03\x41\x01\x45\x01\x41\x01\uffff\x01\x2e\x04\uffff\x01\x3d\x01"+
- "\uffff\x01\x54\x03\uffff\x01\x09\x05\uffff\x01\x54\x01\x49\x01\x4f"+
+ "\x01\x00\x02\x45\x01\x25\x01\x09\x01\x5d\x02\x00\x01\x41\x01\x45"+
+ "\x01\x46\x01\x45\x01\x48\x01\x4c\x01\x49\x01\x4e\x01\x4c\x03\x41"+
+ "\x01\x45\x01\x41\x01\uffff\x01\x2e\x04\uffff\x01\x3d\x01\uffff\x01"+
+ "\x54\x01\uffff\x01\x54\x01\x49\x01\x4f\x02\uffff\x01\x09\x05\uffff"+
"\x01\x4c\x01\x4d\x01\x46\x01\x43\x01\x41\x01\x4f\x01\x52\x01\x41"+
"\x01\x49\x01\x4f\x01\x52\x02\x4c\x01\x45\x01\x53\x01\x43\x01\x57"+
"\x01\x54\x01\x59\x01\x52\x01\x47\x01\x58\x01\x53\x09\uffff\x02\x41"+
@@ -1938,56 +1939,57 @@ private void InitializeCyclicDFAs()
"\x01\x41\x02\uffff\x01\x4c\x01\x41\x02\uffff\x01\x53\x01\x41\x01"+
"\uffff\x04\x41\x02\uffff\x01\x41\x01\uffff\x01\x41\x07\uffff";
const string DFA8_maxS =
- "\x01\uffff\x01\x45\x02\x25\x01\x5d\x02\uffff\x01\x57\x01\x4f\x01"+
+ "\x01\uffff\x01\x45\x01\x57\x02\x25\x01\x5d\x02\uffff\x01\x4f\x01"+
"\x45\x01\x4e\x02\x52\x01\x4c\x01\x4f\x01\x53\x01\x4c\x01\x41\x01"+
"\x45\x01\x52\x01\x45\x01\x41\x01\uffff\x01\x39\x04\uffff\x01\x3d"+
- "\x01\uffff\x01\x54\x03\uffff\x01\x25\x05\uffff\x01\x54\x01\x49\x01"+
- "\x4f\x01\x54\x01\x4d\x01\x46\x01\x53\x01\x7a\x01\x4f\x01\x52\x01"+
- "\x41\x01\x49\x01\x4f\x01\x52\x01\x4e\x01\x4c\x01\x45\x01\x53\x01"+
- "\x43\x01\x57\x01\x54\x01\x59\x01\x52\x01\x47\x01\x58\x01\x53\x09"+
- "\uffff\x02\x7a\x01\x54\x01\x50\x01\x4c\x01\x45\x01\x43\x01\x4d\x01"+
- "\x41\x01\x45\x01\x4c\x01\uffff\x01\x43\x01\x4c\x01\x50\x01\x4c\x01"+
- "\x43\x01\x45\x01\x54\x01\x41\x01\x45\x01\x7a\x01\x49\x01\x52\x01"+
- "\x50\x01\x55\x01\x7a\x01\x4f\x01\x53\x02\x54\x02\uffff\x01\x43\x03"+
- "\x7a\x01\x48\x01\x45\x01\x55\x01\x52\x01\x55\x01\x45\x01\x7a\x01"+
- "\x50\x01\x45\x01\x4b\x01\x41\x01\x45\x01\x4c\x01\x53\x01\uffff\x01"+
- "\x46\x01\x7a\x01\x4f\x01\x45\x01\x52\x01\uffff\x01\x57\x03\x7a\x01"+
- "\x48\x03\uffff\x01\x7a\x01\x4e\x01\x4c\x01\x54\x01\x44\x01\x53\x01"+
- "\uffff\x01\x45\x02\x7a\x01\x43\x01\x52\x01\x7a\x01\x53\x01\x7a\x01"+
- "\uffff\x01\x7a\x01\x52\x01\x4e\x01\x7a\x03\uffff\x01\x7a\x01\uffff"+
- "\x02\x54\x01\x7a\x01\x45\x01\x53\x01\x52\x02\uffff\x01\x48\x01\x7a"+
- "\x01\uffff\x01\x7a\x02\uffff\x01\x4c\x01\x7a\x02\uffff\x01\x53\x01"+
- "\x7a\x01\uffff\x04\x7a\x02\uffff\x01\x7a\x01\uffff\x01\x7a\x07\uffff";
+ "\x01\uffff\x01\x54\x01\uffff\x01\x54\x01\x49\x01\x4f\x02\uffff\x01"+
+ "\x25\x05\uffff\x01\x54\x01\x4d\x01\x46\x01\x53\x01\x7a\x01\x4f\x01"+
+ "\x52\x01\x41\x01\x49\x01\x4f\x01\x52\x01\x4e\x01\x4c\x01\x45\x01"+
+ "\x53\x01\x43\x01\x57\x01\x54\x01\x59\x01\x52\x01\x47\x01\x58\x01"+
+ "\x53\x09\uffff\x02\x7a\x01\x54\x01\x50\x01\x4c\x01\x45\x01\x43\x01"+
+ "\x4d\x01\x41\x01\x45\x01\x4c\x01\uffff\x01\x43\x01\x4c\x01\x50\x01"+
+ "\x4c\x01\x43\x01\x45\x01\x54\x01\x41\x01\x45\x01\x7a\x01\x49\x01"+
+ "\x52\x01\x50\x01\x55\x01\x7a\x01\x4f\x01\x53\x02\x54\x02\uffff\x01"+
+ "\x43\x03\x7a\x01\x48\x01\x45\x01\x55\x01\x52\x01\x55\x01\x45\x01"+
+ "\x7a\x01\x50\x01\x45\x01\x4b\x01\x41\x01\x45\x01\x4c\x01\x53\x01"+
+ "\uffff\x01\x46\x01\x7a\x01\x4f\x01\x45\x01\x52\x01\uffff\x01\x57"+
+ "\x03\x7a\x01\x48\x03\uffff\x01\x7a\x01\x4e\x01\x4c\x01\x54\x01\x44"+
+ "\x01\x53\x01\uffff\x01\x45\x02\x7a\x01\x43\x01\x52\x01\x7a\x01\x53"+
+ "\x01\x7a\x01\uffff\x01\x7a\x01\x52\x01\x4e\x01\x7a\x03\uffff\x01"+
+ "\x7a\x01\uffff\x02\x54\x01\x7a\x01\x45\x01\x53\x01\x52\x02\uffff"+
+ "\x01\x48\x01\x7a\x01\uffff\x01\x7a\x02\uffff\x01\x4c\x01\x7a\x02"+
+ "\uffff\x01\x53\x01\x7a\x01\uffff\x04\x7a\x02\uffff\x01\x7a\x01\uffff"+
+ "\x01\x7a\x07\uffff";
const string DFA8_acceptS =
"\x16\uffff\x01\x28\x01\uffff\x01\x2c\x01\x2d\x01\x2e\x01\x2f\x01"+
- "\uffff\x01\x32\x01\uffff\x01\x28\x01\x02\x01\x04\x01\uffff\x01\x03"+
- "\x01\x05\x01\x07\x01\x06\x01\x08\x1a\uffff\x01\x29\x01\x2a\x01\x2b"+
- "\x01\x2c\x01\x2d\x01\x2e\x01\x2f\x01\x31\x01\x30\x0b\uffff\x01\x13"+
- "\x13\uffff\x01\x01\x01\x09\x12\uffff\x01\x1b\x05\uffff\x01\x1e\x05"+
- "\uffff\x01\x25\x01\x0a\x01\x18\x06\uffff\x01\x1c\x08\uffff\x01\x16"+
- "\x04\uffff\x01\x26\x01\x22\x01\x23\x01\uffff\x01\x20\x06\uffff\x01"+
- "\x12\x01\x10\x02\uffff\x01\x21\x01\uffff\x01\x15\x01\x19\x02\uffff"+
- "\x01\x1f\x01\x17\x02\uffff\x01\x0c\x04\uffff\x01\x1a\x01\x14\x01"+
- "\uffff\x01\x24\x01\uffff\x01\x0b\x01\x0e\x01\x0d\x01\x0f\x01\x11"+
- "\x01\x1d\x01\x27";
+ "\uffff\x01\x32\x01\uffff\x01\x28\x03\uffff\x01\x03\x01\x05\x01\uffff"+
+ "\x01\x04\x01\x06\x01\x08\x01\x07\x01\x09\x17\uffff\x01\x29\x01\x2a"+
+ "\x01\x2b\x01\x2c\x01\x2d\x01\x2e\x01\x2f\x01\x31\x01\x30\x0b\uffff"+
+ "\x01\x13\x13\uffff\x01\x01\x01\x02\x12\uffff\x01\x1b\x05\uffff\x01"+
+ "\x1e\x05\uffff\x01\x25\x01\x0a\x01\x18\x06\uffff\x01\x1c\x08\uffff"+
+ "\x01\x16\x04\uffff\x01\x26\x01\x22\x01\x23\x01\uffff\x01\x20\x06"+
+ "\uffff\x01\x12\x01\x10\x02\uffff\x01\x21\x01\uffff\x01\x15\x01\x19"+
+ "\x02\uffff\x01\x1f\x01\x17\x02\uffff\x01\x0c\x04\uffff\x01\x1a\x01"+
+ "\x14\x01\uffff\x01\x24\x01\uffff\x01\x0b\x01\x0e\x01\x0d\x01\x0f"+
+ "\x01\x11\x01\x1d\x01\x27";
const string DFA8_specialS =
- "\x01\x00\x04\uffff\x01\x01\x01\x02\u00c4\uffff}>";
+ "\x01\x01\x05\uffff\x01\x00\x01\x02\u00c3\uffff}>";
static readonly string[] DFA8_transitionS = {
- "\x09\x1d\x02\x03\x02\x1d\x01\x03\x12\x1d\x01\x03\x01\x1d\x01"+
- "\x05\x02\x1d\x01\x04\x01\x1d\x01\x06\x02\x1d\x01\x1a\x01\x18"+
+ "\x09\x1d\x02\x04\x02\x1d\x01\x04\x12\x1d\x01\x04\x01\x1d\x01"+
+ "\x06\x02\x1d\x01\x05\x01\x1d\x01\x07\x02\x1d\x01\x1a\x01\x18"+
"\x01\x1d\x01\x19\x01\x1d\x01\x1b\x0a\x17\x03\x1d\x01\x1c\x03"+
"\x1d\x01\x16\x01\x0d\x01\x08\x01\x09\x01\x10\x01\x0e\x01\x01"+
"\x01\x16\x01\x0a\x02\x16\x01\x15\x01\x11\x01\x14\x01\x16\x01"+
- "\x0b\x01\x16\x01\x12\x01\x07\x01\x13\x01\x0f\x01\x16\x01\x0c"+
- "\x03\x16\x01\x02\x03\x1d\x01\x16\x01\x1d\x1a\x16\uff85\x1d",
+ "\x0b\x01\x16\x01\x12\x01\x02\x01\x13\x01\x0f\x01\x16\x01\x0c"+
+ "\x03\x16\x01\x03\x03\x1d\x01\x16\x01\x1d\x1a\x16\uff85\x1d",
"\x01\x1e",
- "\x01\x20",
- "\x02\x22\x02\uffff\x01\x22\x12\uffff\x01\x22\x04\uffff\x01"+
- "\x23",
+ "\x01\x20\x0e\uffff\x01\x22\x02\uffff\x01\x21",
"\x01\x23",
- "\x00\x25",
- "\x00\x27",
- "\x01\x28\x0e\uffff\x01\x2a\x02\uffff\x01\x29",
+ "\x02\x25\x02\uffff\x01\x25\x12\uffff\x01\x25\x04\uffff\x01"+
+ "\x26",
+ "\x01\x26",
+ "\x00\x28",
+ "\x00\x2a",
"\x01\x2b\x0d\uffff\x01\x2c",
"\x01\x2d",
"\x01\x2f\x07\uffff\x01\x2e",
@@ -2012,18 +2014,18 @@ private void InitializeCyclicDFAs()
"",
"\x01\x4b",
"",
+ "\x01\x4c",
+ "\x01\x4d",
+ "\x01\x4e",
"",
"",
- "\x02\x22\x02\uffff\x01\x22\x12\uffff\x01\x22\x04\uffff\x01"+
- "\x23",
+ "\x02\x25\x02\uffff\x01\x25\x12\uffff\x01\x25\x04\uffff\x01"+
+ "\x26",
"",
"",
"",
"",
"",
- "\x01\x4c",
- "\x01\x4d",
- "\x01\x4e",
"\x01\x4f\x06\uffff\x01\x50\x01\x51",
"\x01\x52",
"\x01\x53",
@@ -2212,7 +2214,7 @@ public DFA8(BaseRecognizer recognizer)
override public string Description
{
- get { return "1:1: Tokens : ( T__56 | TSTART | TSTOP | WS | QUOTE | SQUOTE | ILITERAL | LITERAL | SET | CALL | DEFAULT | INSERT | PROCESS | INCLUDE | WRAPPER | BLOCK | FOREACH | WHILE | IF | UNLESS | ELSIF | ELSE | SWITCH | CASE | MACRO | FILTER | USE | PERL | RAWPERL | TRY | THROW | CATCH | FINAL | NEXT | LAST | RETURN | STOP | TAGS | COMMENTS | ID | DIGIT | NUMBER | DECIMAL | ADD | SUB | MULT | DIV | ASSIGN | EQUAL | CHAR );"; }
+ get { return "1:1: Tokens : ( T__56 | T__57 | TSTART | TSTOP | WS | QUOTE | SQUOTE | ILITERAL | LITERAL | CALL | DEFAULT | INSERT | PROCESS | INCLUDE | WRAPPER | BLOCK | FOREACH | WHILE | IF | UNLESS | ELSIF | ELSE | SWITCH | CASE | MACRO | FILTER | USE | PERL | RAWPERL | TRY | THROW | CATCH | FINAL | NEXT | LAST | RETURN | STOP | TAGS | COMMENTS | ID | DIGIT | NUMBER | DECIMAL | ADD | SUB | MULT | DIV | ASSIGN | EQUAL | CHAR );"; }
}
}
@@ -2225,22 +2227,32 @@ override public string Description
switch ( s )
{
case 0 :
+ int LA8_6 = input.LA(1);
+
+ s = -1;
+ if ( ((LA8_6 >= '\u0000' && LA8_6 <= '\uFFFF')) ) { s = 40; }
+
+ else s = 39;
+
+ if ( s >= 0 ) return s;
+ break;
+ case 1 :
int LA8_0 = input.LA(1);
s = -1;
if ( (LA8_0 == 'G') ) { s = 1; }
- else if ( (LA8_0 == '[') ) { s = 2; }
+ else if ( (LA8_0 == 'S') ) { s = 2; }
- else if ( ((LA8_0 >= '\t' && LA8_0 <= '\n') || LA8_0 == '\r' || LA8_0 == ' ') ) { s = 3; }
+ else if ( (LA8_0 == '[') ) { s = 3; }
- else if ( (LA8_0 == '%') ) { s = 4; }
+ else if ( ((LA8_0 >= '\t' && LA8_0 <= '\n') || LA8_0 == '\r' || LA8_0 == ' ') ) { s = 4; }
- else if ( (LA8_0 == '\"') ) { s = 5; }
+ else if ( (LA8_0 == '%') ) { s = 5; }
- else if ( (LA8_0 == '\'') ) { s = 6; }
+ else if ( (LA8_0 == '\"') ) { s = 6; }
- else if ( (LA8_0 == 'S') ) { s = 7; }
+ else if ( (LA8_0 == '\'') ) { s = 7; }
else if ( (LA8_0 == 'C') ) { s = 8; }
@@ -2288,23 +2300,13 @@ override public string Description
if ( s >= 0 ) return s;
break;
- case 1 :
- int LA8_5 = input.LA(1);
-
- s = -1;
- if ( ((LA8_5 >= '\u0000' && LA8_5 <= '\uFFFF')) ) { s = 37; }
-
- else s = 36;
-
- if ( s >= 0 ) return s;
- break;
case 2 :
- int LA8_6 = input.LA(1);
+ int LA8_7 = input.LA(1);
s = -1;
- if ( ((LA8_6 >= '\u0000' && LA8_6 <= '\uFFFF')) ) { s = 39; }
+ if ( ((LA8_7 >= '\u0000' && LA8_7 <= '\uFFFF')) ) { s = 42; }
- else s = 38;
+ else s = 41;
if ( s >= 0 ) return s;
break;
View
167 TT/TemplateParser.cs
@@ -1,4 +1,4 @@
-// $ANTLR 3.1.3 Mar 18, 2009 10:09:25 TT\\Template.g 2009-05-30 22:33:00
+// $ANTLR 3.1.3 Mar 18, 2009 10:09:25 TT\\Template.g 2009-06-06 11:23:04
// The variable 'variable' is assigned but its value is never used.
#pragma warning disable 168, 219
@@ -27,6 +27,7 @@ public partial class TemplateParser : Parser
"<DOWN>",
"<UP>",
"GET",
+ "SET",
"PRINT",
"DOCUMENT",
"WS",
@@ -36,7 +37,6 @@ public partial class TemplateParser : Parser
"SQUOTE",
"ILITERAL",
"LITERAL",
- "SET",
"CALL",
"DEFAULT",
"INSERT",
@@ -78,7 +78,8 @@ public partial class TemplateParser : Parser
"ASSIGN",
"EQUAL",
"CHAR",
- "'GET'"
+ "'GET'",
+ "'SET'"
};
public const int WHILE = 23;
@@ -88,15 +89,16 @@ public partial class TemplateParser : Parser
public const int SUB = 50;
public const int ID = 45;
public const int EOF = -1;
- public const int TSTART = 8;
+ public const int TSTART = 9;
public const int IF = 24;
public const int T__56 = 56;
- public const int QUOTE = 10;
- public const int TSTOP = 9;
+ public const int QUOTE = 11;
+ public const int TSTOP = 10;
+ public const int T__57 = 57;
public const int FINAL = 38;
public const int COMMENTS = 44;
public const int INSERT = 17;
- public const int DOCUMENT = 6;
+ public const int DOCUMENT = 7;
public const int EQUAL = 54;
public const int INCLUDE = 19;
public const int RETURN = 41;
@@ -105,23 +107,23 @@ public partial class TemplateParser : Parser
public const int DIGIT = 46;
public const int LAST = 40;
public const int UNLESS = 25;
- public const int ILITERAL = 12;
+ public const int ILITERAL = 13;
public const int ADD = 49;
public const int SWITCH = 28;
public const int DEFAULT = 16;
public const int ELSE = 27;
public const int NUMBER = 47;
public const int TAGS = 43;
- public const int SET = 14;
- public const int LITERAL = 13;
public const int STOP = 42;
+ public const int LITERAL = 14;
+ public const int SET = 5;
public const int MULT = 51;
- public const int SQUOTE = 11;
+ public const int SQUOTE = 12;
public const int WRAPPER = 20;
- public const int PRINT = 5;
+ public const int PRINT = 6;
public const int TRY = 35;
public const int PERL = 33;
- public const int WS = 7;
+ public const int WS = 8;
public const int DECIMAL = 48;
public const int BLOCK = 21;
public const int ASSIGN = 53;
@@ -216,7 +218,7 @@ override public object Tree
case 1 :
// TT\\Template.g:74:4: block
{
- PushFollow(FOLLOW_block_in_document477);
+ PushFollow(FOLLOW_block_in_document474);
block1 = block();
state.followingStackPointer--;
@@ -323,13 +325,13 @@ override public object Tree
{
root_0 = (CommonTree)adaptor.GetNilNode();
- TSTART2=(IToken)Match(input,TSTART,FOLLOW_TSTART_in_block498);
- PushFollow(FOLLOW_statement_in_block501);
+ TSTART2=(IToken)Match(input,TSTART,FOLLOW_TSTART_in_block495);
+ PushFollow(FOLLOW_statement_in_block498);
statement3 = statement();
state.followingStackPointer--;
adaptor.AddChild(root_0, statement3.Tree);
- TSTOP4=(IToken)Match(input,TSTOP,FOLLOW_TSTOP_in_block503);
+ TSTOP4=(IToken)Match(input,TSTOP,FOLLOW_TSTOP_in_block500);
}
@@ -412,7 +414,7 @@ override public object Tree
}
}
break;
- case SET:
+ case 57:
{
alt2 = 2;
}
@@ -431,7 +433,7 @@ override public object Tree
{
root_0 = (CommonTree)adaptor.GetNilNode();
- PushFollow(FOLLOW_getExpr_in_statement516);
+ PushFollow(FOLLOW_getExpr_in_statement513);
getExpr5 = getExpr();
state.followingStackPointer--;
@@ -444,7 +446,7 @@ override public object Tree
{
root_0 = (CommonTree)adaptor.GetNilNode();
- PushFollow(FOLLOW_setExpr_in_statement521);
+ PushFollow(FOLLOW_setExpr_in_statement518);
setExpr6 = setExpr();
state.followingStackPointer--;
@@ -585,7 +587,7 @@ override public object Tree
case 1 :
// TT\\Template.g:87:4: 'GET'
{
- string_literal7=(IToken)Match(input,56,FOLLOW_56_in_getExpr532);
+ string_literal7=(IToken)Match(input,56,FOLLOW_56_in_getExpr529);
stream_56.Add(string_literal7);
@@ -594,7 +596,7 @@ override public object Tree
}
- ID8=(IToken)Match(input,ID,FOLLOW_ID_in_getExpr535);
+ ID8=(IToken)Match(input,ID,FOLLOW_ID_in_getExpr532);
stream_ID.Add(ID8);
@@ -643,7 +645,7 @@ override public object Tree
case 1 :
// TT\\Template.g:88:4: 'GET'
{
- string_literal9=(IToken)Match(input,56,FOLLOW_56_in_getExpr554);
+ string_literal9=(IToken)Match(input,56,FOLLOW_56_in_getExpr551);
stream_56.Add(string_literal9);
@@ -652,7 +654,7 @@ override public object Tree
}
- LITERAL10=(IToken)Match(input,LITERAL,FOLLOW_LITERAL_in_getExpr557);
+ LITERAL10=(IToken)Match(input,LITERAL,FOLLOW_LITERAL_in_getExpr554);
stream_LITERAL.Add(LITERAL10);
@@ -701,7 +703,7 @@ override public object Tree
case 1 :
// TT\\Template.g:89:4: 'GET'
{
- string_literal11=(IToken)Match(input,56,FOLLOW_56_in_getExpr571);
+ string_literal11=(IToken)Match(input,56,FOLLOW_56_in_getExpr568);
stream_56.Add(string_literal11);
@@ -710,7 +712,7 @@ override public object Tree
}
- ILITERAL12=(IToken)Match(input,ILITERAL,FOLLOW_ILITERAL_in_getExpr574);
+ ILITERAL12=(IToken)Match(input,ILITERAL,FOLLOW_ILITERAL_in_getExpr571);
stream_ILITERAL.Add(ILITERAL12);
@@ -776,76 +778,93 @@ override public object Tree
};
// $ANTLR start "setExpr"
- // TT\\Template.g:92:1: setExpr : ( SET )? ID ASSIGN ( ID | LITERAL | ILITERAL | NUMBER | DECIMAL ) ;
+ // TT\\Template.g:92:1: setExpr : ( 'SET' )? ID ASSIGN LITERAL -> ^( SET ID LITERAL ) ;
public TemplateParser.setExpr_return setExpr() // throws RecognitionException [1]
{
TemplateParser.setExpr_return retval = new TemplateParser.setExpr_return();
retval.Start = input.LT(1);
CommonTree root_0 = null;
- IToken SET13 = null;
+ IToken string_literal13 = null;
IToken ID14 = null;
IToken ASSIGN15 = null;
- IToken set16 = null;
+ IToken LITERAL16 = null;
- CommonTree SET13_tree=null;
+ CommonTree string_literal13_tree=null;
CommonTree ID14_tree=null;
CommonTree ASSIGN15_tree=null;
- CommonTree set16_tree=null;
+ CommonTree LITERAL16_tree=null;
+ RewriteRuleTokenStream stream_LITERAL = new RewriteRuleTokenStream(adaptor,"token LITERAL");
+ RewriteRuleTokenStream stream_57 = new RewriteRuleTokenStream(adaptor,"token 57");
+ RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,"token ID");
+ RewriteRuleTokenStream stream_ASSIGN = new RewriteRuleTokenStream(adaptor,"token ASSIGN");
try
{
- // TT\\Template.g:93:2: ( ( SET )? ID ASSIGN ( ID | LITERAL | ILITERAL | NUMBER | DECIMAL ) )
- // TT\\Template.g:93:4: ( SET )? ID ASSIGN ( ID | LITERAL | ILITERAL | NUMBER | DECIMAL )
+ // TT\\Template.g:93:2: ( ( 'SET' )? ID ASSIGN LITERAL -> ^( SET ID LITERAL ) )
+ // TT\\Template.g:93:4: ( 'SET' )? ID ASSIGN LITERAL
{
- root_0 = (CommonTree)adaptor.GetNilNode();
-
- // TT\\Template.g:93:4: ( SET )?
+ // TT\\Template.g:93:4: ( 'SET' )?
int alt7 = 2;
int LA7_0 = input.LA(1);
- if ( (LA7_0 == SET) )
+ if ( (LA7_0 == 57) )
{
alt7 = 1;
}
switch (alt7)
{
case 1 :
- // TT\\Template.g:93:4: SET
+ // TT\\Template.g:93:4: 'SET'
{
- SET13=(IToken)Match(input,SET,FOLLOW_SET_in_setExpr593);
- SET13_tree = (CommonTree)adaptor.Create(SET13);
- adaptor.AddChild(root_0, SET13_tree);
+ string_literal13=(IToken)Match(input,57,FOLLOW_57_in_setExpr590);
+ stream_57.Add(string_literal13);
}
break;
}
- ID14=(IToken)Match(input,ID,FOLLOW_ID_in_setExpr596);
- ID14_tree = (CommonTree)adaptor.Create(ID14);
- adaptor.AddChild(root_0, ID14_tree);
+ ID14=(IToken)Match(input,ID,FOLLOW_ID_in_setExpr593);
+ stream_ID.Add(ID14);
- ASSIGN15=(IToken)Match(input,ASSIGN,FOLLOW_ASSIGN_in_setExpr598);
- ASSIGN15_tree = (CommonTree)adaptor.Create(ASSIGN15);
- adaptor.AddChild(root_0, ASSIGN15_tree);
+ ASSIGN15=(IToken)Match(input,ASSIGN,FOLLOW_ASSIGN_in_setExpr595);
+ stream_ASSIGN.Add(ASSIGN15);
- set16 = (IToken)input.LT(1);
- if ( (input.LA(1) >= ILITERAL && input.LA(1) <= LITERAL) || input.LA(1) == ID || (input.LA(1) >= NUMBER && input.LA(1) <= DECIMAL) )
- {
- input.Consume();
- adaptor.AddChild(root_0, (CommonTree)adaptor.Create(set16));
- state.errorRecovery = false;
- }
- else
+ LITERAL16=(IToken)Match(input,LITERAL,FOLLOW_LITERAL_in_setExpr597);
+ stream_LITERAL.Add(LITERAL16);
+
+
+
+ // AST REWRITE
+ // elements: LITERAL, ID
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ // wildcard labels:
+ retval.Tree = root_0;
+ RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval!=null ? retval.Tree : null);
+
+ root_0 = (CommonTree)adaptor.GetNilNode();
+ // 93:29: -> ^( SET ID LITERAL )
{
- MismatchedSetException mse = new MismatchedSetException(null,input);
- throw mse;
- }
+ // TT\\Template.g:93:32: ^( SET ID LITERAL )
+ {
+ CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
+ root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(SET, "SET"), root_1);
+
+ adaptor.AddChild(root_1, stream_ID.NextNode());
+ adaptor.AddChild(root_1, stream_LITERAL.NextNode());
+ adaptor.AddChild(root_0, root_1);
+ }
+ }
+
+ retval.Tree = root_0;retval.Tree = root_0;
}
retval.Stop = input.LT(-1);
@@ -877,22 +896,22 @@ private void InitializeCyclicDFAs()
- public static readonly BitSet FOLLOW_block_in_document477 = new BitSet(new ulong[]{0x0000000000000102UL});
- public static readonly BitSet FOLLOW_TSTART_in_block498 = new BitSet(new ulong[]{0x0100200000007000UL});
- public static readonly BitSet FOLLOW_statement_in_block501 = new BitSet(new ulong[]{0x0000000000000200UL});
- public static readonly BitSet FOLLOW_TSTOP_in_block503 = new BitSet(new ulong[]{0x0000000000000002UL});
- public static readonly BitSet FOLLOW_getExpr_in_statement516 = new BitSet(new ulong[]{0x0000000000000002UL});
- public static readonly BitSet FOLLOW_setExpr_in_statement521 = new BitSet(new ulong[]{0x0000000000000002UL});
- public static readonly BitSet FOLLOW_56_in_getExpr532 = new BitSet(new ulong[]{0x0000200000000000UL});
- public static readonly BitSet FOLLOW_ID_in_getExpr535 = new BitSet(new ulong[]{0x0000000000000002UL});
- public static readonly BitSet FOLLOW_56_in_getExpr554 = new BitSet(new ulong[]{0x0000000000002000UL});
- public static readonly BitSet FOLLOW_LITERAL_in_getExpr557 = new BitSet(new ulong[]{0x0000000000000002UL});
- public static readonly BitSet FOLLOW_56_in_getExpr571 = new BitSet(new ulong[]{0x0000000000001000UL});
- public static readonly BitSet FOLLOW_ILITERAL_in_getExpr574 = new BitSet(new ulong[]{0x0000000000000002UL});
- public static readonly BitSet FOLLOW_SET_in_setExpr593 = new BitSet(new ulong[]{0x0000200000000000UL});
- public static readonly BitSet FOLLOW_ID_in_setExpr596 = new BitSet(new ulong[]{0x0020000000000000UL});
- public static readonly BitSet FOLLOW_ASSIGN_in_setExpr598 = new BitSet(new ulong[]{0x0001A00000003000UL});
- public static readonly BitSet FOLLOW_set_in_setExpr600 = new BitSet(new ulong[]{0x0000000000000002UL});
+ public static readonly BitSet FOLLOW_block_in_document474 = new BitSet(new ulong[]{0x0000000000000202UL});
+ public static readonly BitSet FOLLOW_TSTART_in_block495 = new BitSet(new ulong[]{0x0300200000006000UL});
+ public static readonly BitSet FOLLOW_statement_in_block498 = new BitSet(new ulong[]{0x0000000000000400UL});
+ public static readonly BitSet FOLLOW_TSTOP_in_block500 = new BitSet(new ulong[]{0x0000000000000002UL});
+ public static readonly BitSet FOLLOW_getExpr_in_statement513 = new BitSet(new ulong[]{0x0000000000000002UL});
+ public static readonly BitSet FOLLOW_setExpr_in_statement518 = new BitSet(new ulong[]{0x0000000000000002UL});
+ public static readonly BitSet FOLLOW_56_in_getExpr529 = new BitSet(new ulong[]{0x0000200000000000UL});
+ public static readonly BitSet FOLLOW_ID_in_getExpr532 = new BitSet(new ulong[]{0x0000000000000002UL});
+ public static readonly BitSet FOLLOW_56_in_getExpr551 = new BitSet(new ulong[]{0x0000000000004000UL});
+ public static readonly BitSet FOLLOW_LITERAL_in_getExpr554 = new BitSet(new ulong[]{0x0000000000000002UL});
+ public static readonly BitSet FOLLOW_56_in_getExpr568 = new BitSet(new ulong[]{0x0000000000002000UL});
+ public static readonly BitSet FOLLOW_ILITERAL_in_getExpr571 = new BitSet(new ulong[]{0x0000000000000002UL});
+ public static readonly BitSet FOLLOW_57_in_setExpr590 = new BitSet(new ulong[]{0x0000200000000000UL});
+ public static readonly BitSet FOLLOW_ID_in_setExpr593 = new BitSet(new ulong[]{0x0020000000000000UL});
+ public static readonly BitSet FOLLOW_ASSIGN_in_setExpr595 = new BitSet(new ulong[]{0x0000000000004000UL});
+ public static readonly BitSet FOLLOW_LITERAL_in_setExpr597 = new BitSet(new ulong[]{0x0000000000000002UL});
}
}

0 comments on commit 1403781

Please sign in to comment.