diff options
author | Melanie Thielker | 2008-07-12 01:34:36 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-07-12 01:34:36 +0000 |
commit | d85774c101f5509672fc8d791fa3c923fc2071c9 (patch) | |
tree | 5282e5f1e55a85f5f6c5c56fdecff097bcf0a677 /OpenSim | |
parent | Overloads CreateMesh method of interface IMesher to pass prim physical status... (diff) | |
download | opensim-SC-d85774c101f5509672fc8d791fa3c923fc2071c9.zip opensim-SC-d85774c101f5509672fc8d791fa3c923fc2071c9.tar.gz opensim-SC-d85774c101f5509672fc8d791fa3c923fc2071c9.tar.bz2 opensim-SC-d85774c101f5509672fc8d791fa3c923fc2071c9.tar.xz |
Patch #9142 (No mantis)
Add a config option to OpenSim.ini to select between script compilers
in the XEngine without recompile.
Set UseNewCompiler=true in OpenSim.ini and try it out.
Creates the ICodeConverter interface and adapts the new compiler to it.
Diffstat (limited to 'OpenSim')
5 files changed, 121 insertions, 80 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index 82c7eda..7d7384e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |||
@@ -32,7 +32,7 @@ using Tools; | |||
32 | 32 | ||
33 | namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | 33 | namespace OpenSim.Region.ScriptEngine.Shared.CodeTools |
34 | { | 34 | { |
35 | public class CSCodeGenerator | 35 | public class CSCodeGenerator : ICodeConverter |
36 | { | 36 | { |
37 | private SYMBOL m_astRoot = null; | 37 | private SYMBOL m_astRoot = null; |
38 | private int m_braceCount; // for indentation | 38 | private int m_braceCount; // for indentation |
@@ -41,12 +41,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
41 | /// Pass the new CodeGenerator a string containing the LSL source. | 41 | /// Pass the new CodeGenerator a string containing the LSL source. |
42 | /// </summary> | 42 | /// </summary> |
43 | /// <param name="script">String containing LSL source.</param> | 43 | /// <param name="script">String containing LSL source.</param> |
44 | public CSCodeGenerator(string script) | 44 | public CSCodeGenerator() |
45 | { | 45 | { |
46 | Parser p = new LSLSyntax(new yyLSLSyntax(), new ErrorHandler(true)); | ||
47 | // Obviously this needs to be in a try/except block. | ||
48 | LSL2CSCodeTransformer codeTransformer = new LSL2CSCodeTransformer(p.Parse(script)); | ||
49 | m_astRoot = codeTransformer.Transform(); | ||
50 | } | 46 | } |
51 | 47 | ||
52 | /// <summary> | 48 | /// <summary> |
@@ -63,8 +59,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
63 | /// Generate the code from the AST we have. | 59 | /// Generate the code from the AST we have. |
64 | /// </summary> | 60 | /// </summary> |
65 | /// <returns>String containing the generated C# code.</returns> | 61 | /// <returns>String containing the generated C# code.</returns> |
66 | public string Generate() | 62 | public string Convert(string script) |
67 | { | 63 | { |
64 | Parser p = new LSLSyntax(new yyLSLSyntax(), new ErrorHandler(true)); | ||
65 | // Obviously this needs to be in a try/except block. | ||
66 | LSL2CSCodeTransformer codeTransformer = new LSL2CSCodeTransformer(p.Parse(script)); | ||
67 | m_astRoot = codeTransformer.Transform(); | ||
68 | string retstr = String.Empty; | 68 | string retstr = String.Empty; |
69 | 69 | ||
70 | // standard preamble | 70 | // standard preamble |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 124f1e6..09d816f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -72,8 +72,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
72 | private string FilePrefix; | 72 | private string FilePrefix; |
73 | private string ScriptEnginesPath = "ScriptEngines"; | 73 | private string ScriptEnginesPath = "ScriptEngines"; |
74 | 74 | ||
75 | private static LSL2CSConverter LSL_Converter = new LSL2CSConverter(); | 75 | private static ICodeConverter LSL_Converter; |
76 | //private static CSCodeGenerator LSL_Converter; | ||
77 | private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); | 76 | private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); |
78 | private static VBCodeProvider VBcodeProvider = new VBCodeProvider(); | 77 | private static VBCodeProvider VBcodeProvider = new VBCodeProvider(); |
79 | private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); | 78 | private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); |
@@ -82,6 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
82 | 81 | ||
83 | // private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files | 82 | // private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files |
84 | private static UInt64 scriptCompileCounter = 0; // And a counter | 83 | private static UInt64 scriptCompileCounter = 0; // And a counter |
84 | private bool m_UseCompiler = false; | ||
85 | 85 | ||
86 | public IScriptEngine m_scriptEngine; | 86 | public IScriptEngine m_scriptEngine; |
87 | public Compiler(IScriptEngine scriptEngine) | 87 | public Compiler(IScriptEngine scriptEngine) |
@@ -94,6 +94,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
94 | { | 94 | { |
95 | 95 | ||
96 | // Get some config | 96 | // Get some config |
97 | m_UseCompiler = m_scriptEngine.Config.GetBoolean("UseNewCompiler", true); | ||
97 | WriteScriptSourceToDebugFile = m_scriptEngine.Config.GetBoolean("WriteScriptSourceToDebugFile", true); | 98 | WriteScriptSourceToDebugFile = m_scriptEngine.Config.GetBoolean("WriteScriptSourceToDebugFile", true); |
98 | CompileWithDebugInformation = m_scriptEngine.Config.GetBoolean("CompileWithDebugInformation", true); | 99 | CompileWithDebugInformation = m_scriptEngine.Config.GetBoolean("CompileWithDebugInformation", true); |
99 | 100 | ||
@@ -324,9 +325,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
324 | if (l == enumCompileType.lsl) | 325 | if (l == enumCompileType.lsl) |
325 | { | 326 | { |
326 | // Its LSL, convert it to C# | 327 | // Its LSL, convert it to C# |
328 | //compileScript = LSL_Converter.Convert(Script); | ||
329 | if(m_UseCompiler) | ||
330 | LSL_Converter = (ICodeConverter)new CSCodeGenerator(); | ||
331 | else | ||
332 | LSL_Converter = (ICodeConverter)new LSL2CSConverter(); | ||
327 | compileScript = LSL_Converter.Convert(Script); | 333 | compileScript = LSL_Converter.Convert(Script); |
328 | //LSL_Converter = new CSCodeGenerator(Script); | ||
329 | //compileScript = LSL_Converter.Generate(); | ||
330 | l = enumCompileType.cs; | 334 | l = enumCompileType.cs; |
331 | } | 335 | } |
332 | 336 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/ICodeConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/ICodeConverter.cs new file mode 100644 index 0000000..a57530c --- /dev/null +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/ICodeConverter.cs | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | using System; | ||
30 | |||
31 | namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | ||
32 | { | ||
33 | public interface ICodeConverter | ||
34 | { | ||
35 | string Convert(string script); | ||
36 | } | ||
37 | } | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs index 380686e..7e9789f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs | |||
@@ -32,7 +32,7 @@ using System.Text.RegularExpressions; | |||
32 | 32 | ||
33 | namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | 33 | namespace OpenSim.Region.ScriptEngine.Shared.CodeTools |
34 | { | 34 | { |
35 | public class LSL2CSConverter | 35 | public class LSL2CSConverter : ICodeConverter |
36 | { | 36 | { |
37 | // Uses regex to convert LSL code to C# code. | 37 | // Uses regex to convert LSL code to C# code. |
38 | 38 | ||
diff --git a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSLCompilerTest.cs b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSLCompilerTest.cs index 3413d0d..890a634 100644 --- a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSLCompilerTest.cs +++ b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSLCompilerTest.cs | |||
@@ -56,8 +56,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests | |||
56 | } | 56 | } |
57 | "; | 57 | "; |
58 | 58 | ||
59 | CSCodeGenerator cg = new CSCodeGenerator(input); | 59 | CSCodeGenerator cg = new CSCodeGenerator(); |
60 | string output = cg.Generate(); | 60 | string output = cg.Convert(input); |
61 | Assert.AreEqual(expected, output); | 61 | Assert.AreEqual(expected, output); |
62 | } | 62 | } |
63 | 63 | ||
@@ -87,8 +87,8 @@ state another_state | |||
87 | } | 87 | } |
88 | "; | 88 | "; |
89 | 89 | ||
90 | CSCodeGenerator cg = new CSCodeGenerator(input); | 90 | CSCodeGenerator cg = new CSCodeGenerator(); |
91 | string output = cg.Generate(); | 91 | string output = cg.Convert(input); |
92 | Assert.AreEqual(expected, output); | 92 | Assert.AreEqual(expected, output); |
93 | } | 93 | } |
94 | 94 | ||
@@ -108,8 +108,8 @@ state another_state | |||
108 | } | 108 | } |
109 | "; | 109 | "; |
110 | 110 | ||
111 | CSCodeGenerator cg = new CSCodeGenerator(input); | 111 | CSCodeGenerator cg = new CSCodeGenerator(); |
112 | string output = cg.Generate(); | 112 | string output = cg.Convert(input); |
113 | Assert.AreEqual(expected, output); | 113 | Assert.AreEqual(expected, output); |
114 | } | 114 | } |
115 | 115 | ||
@@ -131,8 +131,8 @@ state another_state | |||
131 | } | 131 | } |
132 | "; | 132 | "; |
133 | 133 | ||
134 | CSCodeGenerator cg = new CSCodeGenerator(input); | 134 | CSCodeGenerator cg = new CSCodeGenerator(); |
135 | string output = cg.Generate(); | 135 | string output = cg.Convert(input); |
136 | Assert.AreEqual(expected, output); | 136 | Assert.AreEqual(expected, output); |
137 | } | 137 | } |
138 | 138 | ||
@@ -158,8 +158,8 @@ state another_state | |||
158 | } | 158 | } |
159 | "; | 159 | "; |
160 | 160 | ||
161 | CSCodeGenerator cg = new CSCodeGenerator(input); | 161 | CSCodeGenerator cg = new CSCodeGenerator(); |
162 | string output = cg.Generate(); | 162 | string output = cg.Convert(input); |
163 | Assert.AreEqual(expected, output); | 163 | Assert.AreEqual(expected, output); |
164 | } | 164 | } |
165 | 165 | ||
@@ -187,8 +187,8 @@ state another_state | |||
187 | } | 187 | } |
188 | "; | 188 | "; |
189 | 189 | ||
190 | CSCodeGenerator cg = new CSCodeGenerator(input); | 190 | CSCodeGenerator cg = new CSCodeGenerator(); |
191 | string output = cg.Generate(); | 191 | string output = cg.Convert(input); |
192 | Assert.AreEqual(expected, output); | 192 | Assert.AreEqual(expected, output); |
193 | } | 193 | } |
194 | 194 | ||
@@ -214,8 +214,8 @@ state another_state | |||
214 | } | 214 | } |
215 | "; | 215 | "; |
216 | 216 | ||
217 | CSCodeGenerator cg = new CSCodeGenerator(input); | 217 | CSCodeGenerator cg = new CSCodeGenerator(); |
218 | string output = cg.Generate(); | 218 | string output = cg.Convert(input); |
219 | Assert.AreEqual(expected, output); | 219 | Assert.AreEqual(expected, output); |
220 | } | 220 | } |
221 | 221 | ||
@@ -253,8 +253,8 @@ state another_state | |||
253 | } | 253 | } |
254 | "; | 254 | "; |
255 | 255 | ||
256 | CSCodeGenerator cg = new CSCodeGenerator(input); | 256 | CSCodeGenerator cg = new CSCodeGenerator(); |
257 | string output = cg.Generate(); | 257 | string output = cg.Convert(input); |
258 | Assert.AreEqual(expected, output); | 258 | Assert.AreEqual(expected, output); |
259 | } | 259 | } |
260 | 260 | ||
@@ -306,8 +306,8 @@ state another_state | |||
306 | } | 306 | } |
307 | "; | 307 | "; |
308 | 308 | ||
309 | CSCodeGenerator cg = new CSCodeGenerator(input); | 309 | CSCodeGenerator cg = new CSCodeGenerator(); |
310 | string output = cg.Generate(); | 310 | string output = cg.Convert(input); |
311 | Assert.AreEqual(expected, output); | 311 | Assert.AreEqual(expected, output); |
312 | } | 312 | } |
313 | 313 | ||
@@ -329,8 +329,8 @@ default | |||
329 | } | 329 | } |
330 | "; | 330 | "; |
331 | 331 | ||
332 | CSCodeGenerator cg = new CSCodeGenerator(input); | 332 | CSCodeGenerator cg = new CSCodeGenerator(); |
333 | string output = cg.Generate(); | 333 | string output = cg.Convert(input); |
334 | Assert.AreEqual(expected, output); | 334 | Assert.AreEqual(expected, output); |
335 | } | 335 | } |
336 | 336 | ||
@@ -368,8 +368,8 @@ default | |||
368 | } | 368 | } |
369 | "; | 369 | "; |
370 | 370 | ||
371 | CSCodeGenerator cg = new CSCodeGenerator(input); | 371 | CSCodeGenerator cg = new CSCodeGenerator(); |
372 | string output = cg.Generate(); | 372 | string output = cg.Convert(input); |
373 | Assert.AreEqual(expected, output); | 373 | Assert.AreEqual(expected, output); |
374 | } | 374 | } |
375 | 375 | ||
@@ -413,8 +413,8 @@ default | |||
413 | } | 413 | } |
414 | "; | 414 | "; |
415 | 415 | ||
416 | CSCodeGenerator cg = new CSCodeGenerator(input); | 416 | CSCodeGenerator cg = new CSCodeGenerator(); |
417 | string output = cg.Generate(); | 417 | string output = cg.Convert(input); |
418 | Assert.AreEqual(expected, output); | 418 | Assert.AreEqual(expected, output); |
419 | } | 419 | } |
420 | 420 | ||
@@ -469,8 +469,8 @@ default | |||
469 | } | 469 | } |
470 | "; | 470 | "; |
471 | 471 | ||
472 | CSCodeGenerator cg = new CSCodeGenerator(input); | 472 | CSCodeGenerator cg = new CSCodeGenerator(); |
473 | string output = cg.Generate(); | 473 | string output = cg.Convert(input); |
474 | Assert.AreEqual(expected, output); | 474 | Assert.AreEqual(expected, output); |
475 | } | 475 | } |
476 | 476 | ||
@@ -524,8 +524,8 @@ default | |||
524 | } | 524 | } |
525 | "; | 525 | "; |
526 | 526 | ||
527 | CSCodeGenerator cg = new CSCodeGenerator(input); | 527 | CSCodeGenerator cg = new CSCodeGenerator(); |
528 | string output = cg.Generate(); | 528 | string output = cg.Convert(input); |
529 | Assert.AreEqual(expected, output); | 529 | Assert.AreEqual(expected, output); |
530 | } | 530 | } |
531 | 531 | ||
@@ -552,8 +552,8 @@ default | |||
552 | } | 552 | } |
553 | "; | 553 | "; |
554 | 554 | ||
555 | CSCodeGenerator cg = new CSCodeGenerator(input); | 555 | CSCodeGenerator cg = new CSCodeGenerator(); |
556 | string output = cg.Generate(); | 556 | string output = cg.Convert(input); |
557 | Assert.AreEqual(expected, output); | 557 | Assert.AreEqual(expected, output); |
558 | } | 558 | } |
559 | 559 | ||
@@ -579,8 +579,8 @@ default | |||
579 | } | 579 | } |
580 | "; | 580 | "; |
581 | 581 | ||
582 | CSCodeGenerator cg = new CSCodeGenerator(input); | 582 | CSCodeGenerator cg = new CSCodeGenerator(); |
583 | string output = cg.Generate(); | 583 | string output = cg.Convert(input); |
584 | Assert.AreEqual(expected, output); | 584 | Assert.AreEqual(expected, output); |
585 | } | 585 | } |
586 | 586 | ||
@@ -608,8 +608,8 @@ default | |||
608 | } | 608 | } |
609 | "; | 609 | "; |
610 | 610 | ||
611 | CSCodeGenerator cg = new CSCodeGenerator(input); | 611 | CSCodeGenerator cg = new CSCodeGenerator(); |
612 | string output = cg.Generate(); | 612 | string output = cg.Convert(input); |
613 | Assert.AreEqual(expected, output); | 613 | Assert.AreEqual(expected, output); |
614 | } | 614 | } |
615 | 615 | ||
@@ -639,8 +639,8 @@ default | |||
639 | } | 639 | } |
640 | "; | 640 | "; |
641 | 641 | ||
642 | CSCodeGenerator cg = new CSCodeGenerator(input); | 642 | CSCodeGenerator cg = new CSCodeGenerator(); |
643 | string output = cg.Generate(); | 643 | string output = cg.Convert(input); |
644 | Assert.AreEqual(expected, output); | 644 | Assert.AreEqual(expected, output); |
645 | } | 645 | } |
646 | 646 | ||
@@ -668,8 +668,8 @@ default | |||
668 | } | 668 | } |
669 | "; | 669 | "; |
670 | 670 | ||
671 | CSCodeGenerator cg = new CSCodeGenerator(input); | 671 | CSCodeGenerator cg = new CSCodeGenerator(); |
672 | string output = cg.Generate(); | 672 | string output = cg.Convert(input); |
673 | Assert.AreEqual(expected, output); | 673 | Assert.AreEqual(expected, output); |
674 | } | 674 | } |
675 | 675 | ||
@@ -773,8 +773,8 @@ default | |||
773 | } | 773 | } |
774 | "; | 774 | "; |
775 | 775 | ||
776 | CSCodeGenerator cg = new CSCodeGenerator(input); | 776 | CSCodeGenerator cg = new CSCodeGenerator(); |
777 | string output = cg.Generate(); | 777 | string output = cg.Convert(input); |
778 | Assert.AreEqual(expected, output); | 778 | Assert.AreEqual(expected, output); |
779 | } | 779 | } |
780 | 780 | ||
@@ -880,8 +880,8 @@ default | |||
880 | } | 880 | } |
881 | "; | 881 | "; |
882 | 882 | ||
883 | CSCodeGenerator cg = new CSCodeGenerator(input); | 883 | CSCodeGenerator cg = new CSCodeGenerator(); |
884 | string output = cg.Generate(); | 884 | string output = cg.Convert(input); |
885 | Assert.AreEqual(expected, output); | 885 | Assert.AreEqual(expected, output); |
886 | } | 886 | } |
887 | 887 | ||
@@ -921,8 +921,8 @@ default | |||
921 | } | 921 | } |
922 | "; | 922 | "; |
923 | 923 | ||
924 | CSCodeGenerator cg = new CSCodeGenerator(input); | 924 | CSCodeGenerator cg = new CSCodeGenerator(); |
925 | string output = cg.Generate(); | 925 | string output = cg.Convert(input); |
926 | Assert.AreEqual(expected, output); | 926 | Assert.AreEqual(expected, output); |
927 | } | 927 | } |
928 | 928 | ||
@@ -966,8 +966,8 @@ default | |||
966 | } | 966 | } |
967 | "; | 967 | "; |
968 | 968 | ||
969 | CSCodeGenerator cg = new CSCodeGenerator(input); | 969 | CSCodeGenerator cg = new CSCodeGenerator(); |
970 | string output = cg.Generate(); | 970 | string output = cg.Convert(input); |
971 | Assert.AreEqual(expected, output); | 971 | Assert.AreEqual(expected, output); |
972 | } | 972 | } |
973 | 973 | ||
@@ -1011,8 +1011,8 @@ default | |||
1011 | } | 1011 | } |
1012 | "; | 1012 | "; |
1013 | 1013 | ||
1014 | CSCodeGenerator cg = new CSCodeGenerator(input); | 1014 | CSCodeGenerator cg = new CSCodeGenerator(); |
1015 | string output = cg.Generate(); | 1015 | string output = cg.Convert(input); |
1016 | Assert.AreEqual(expected, output); | 1016 | Assert.AreEqual(expected, output); |
1017 | } | 1017 | } |
1018 | 1018 | ||
@@ -1064,8 +1064,8 @@ default | |||
1064 | } | 1064 | } |
1065 | "; | 1065 | "; |
1066 | 1066 | ||
1067 | CSCodeGenerator cg = new CSCodeGenerator(input); | 1067 | CSCodeGenerator cg = new CSCodeGenerator(); |
1068 | string output = cg.Generate(); | 1068 | string output = cg.Convert(input); |
1069 | Assert.AreEqual(expected, output); | 1069 | Assert.AreEqual(expected, output); |
1070 | } | 1070 | } |
1071 | 1071 | ||
@@ -1101,8 +1101,8 @@ default | |||
1101 | } | 1101 | } |
1102 | "; | 1102 | "; |
1103 | 1103 | ||
1104 | CSCodeGenerator cg = new CSCodeGenerator(input); | 1104 | CSCodeGenerator cg = new CSCodeGenerator(); |
1105 | string output = cg.Generate(); | 1105 | string output = cg.Convert(input); |
1106 | Assert.AreEqual(expected, output); | 1106 | Assert.AreEqual(expected, output); |
1107 | } | 1107 | } |
1108 | 1108 | ||
@@ -1147,8 +1147,8 @@ default | |||
1147 | } | 1147 | } |
1148 | "; | 1148 | "; |
1149 | 1149 | ||
1150 | CSCodeGenerator cg = new CSCodeGenerator(input); | 1150 | CSCodeGenerator cg = new CSCodeGenerator(); |
1151 | string output = cg.Generate(); | 1151 | string output = cg.Convert(input); |
1152 | Assert.AreEqual(expected, output); | 1152 | Assert.AreEqual(expected, output); |
1153 | } | 1153 | } |
1154 | 1154 | ||
@@ -1188,8 +1188,8 @@ state statetwo | |||
1188 | } | 1188 | } |
1189 | "; | 1189 | "; |
1190 | 1190 | ||
1191 | CSCodeGenerator cg = new CSCodeGenerator(input); | 1191 | CSCodeGenerator cg = new CSCodeGenerator(); |
1192 | string output = cg.Generate(); | 1192 | string output = cg.Convert(input); |
1193 | Assert.AreEqual(expected, output); | 1193 | Assert.AreEqual(expected, output); |
1194 | } | 1194 | } |
1195 | 1195 | ||
@@ -1221,8 +1221,8 @@ default | |||
1221 | } | 1221 | } |
1222 | "; | 1222 | "; |
1223 | 1223 | ||
1224 | CSCodeGenerator cg = new CSCodeGenerator(input); | 1224 | CSCodeGenerator cg = new CSCodeGenerator(); |
1225 | string output = cg.Generate(); | 1225 | string output = cg.Convert(input); |
1226 | Assert.AreEqual(expected, output); | 1226 | Assert.AreEqual(expected, output); |
1227 | } | 1227 | } |
1228 | 1228 | ||
@@ -1252,8 +1252,8 @@ default | |||
1252 | } | 1252 | } |
1253 | "; | 1253 | "; |
1254 | 1254 | ||
1255 | CSCodeGenerator cg = new CSCodeGenerator(input); | 1255 | CSCodeGenerator cg = new CSCodeGenerator(); |
1256 | string output = cg.Generate(); | 1256 | string output = cg.Convert(input); |
1257 | Assert.AreEqual(expected, output); | 1257 | Assert.AreEqual(expected, output); |
1258 | } | 1258 | } |
1259 | 1259 | ||
@@ -1296,8 +1296,8 @@ default | |||
1296 | } | 1296 | } |
1297 | "; | 1297 | "; |
1298 | 1298 | ||
1299 | CSCodeGenerator cg = new CSCodeGenerator(input); | 1299 | CSCodeGenerator cg = new CSCodeGenerator(); |
1300 | string output = cg.Generate(); | 1300 | string output = cg.Convert(input); |
1301 | Assert.AreEqual(expected, output); | 1301 | Assert.AreEqual(expected, output); |
1302 | } | 1302 | } |
1303 | 1303 | ||
@@ -1329,8 +1329,8 @@ default | |||
1329 | } | 1329 | } |
1330 | "; | 1330 | "; |
1331 | 1331 | ||
1332 | CSCodeGenerator cg = new CSCodeGenerator(input); | 1332 | CSCodeGenerator cg = new CSCodeGenerator(); |
1333 | string output = cg.Generate(); | 1333 | string output = cg.Convert(input); |
1334 | Assert.AreEqual(expected, output); | 1334 | Assert.AreEqual(expected, output); |
1335 | } | 1335 | } |
1336 | 1336 | ||
@@ -1354,8 +1354,8 @@ default | |||
1354 | } | 1354 | } |
1355 | "; | 1355 | "; |
1356 | 1356 | ||
1357 | CSCodeGenerator cg = new CSCodeGenerator(input); | 1357 | CSCodeGenerator cg = new CSCodeGenerator(); |
1358 | string output = cg.Generate(); | 1358 | string output = cg.Convert(input); |
1359 | Assert.AreEqual(expected, output); | 1359 | Assert.AreEqual(expected, output); |
1360 | } | 1360 | } |
1361 | 1361 | ||
@@ -1373,8 +1373,8 @@ default | |||
1373 | "; | 1373 | "; |
1374 | try | 1374 | try |
1375 | { | 1375 | { |
1376 | CSCodeGenerator cg = new CSCodeGenerator(input); | 1376 | CSCodeGenerator cg = new CSCodeGenerator(); |
1377 | cg.Generate(); | 1377 | cg.Convert(input); |
1378 | } | 1378 | } |
1379 | catch (Tools.CSToolsException e) | 1379 | catch (Tools.CSToolsException e) |
1380 | { | 1380 | { |