BaseCompiler.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. //
  2. // System.Web.Compilation.BaseCompiler
  3. //
  4. // Authors:
  5. // Gonzalo Paniagua Javier ([email protected])
  6. //
  7. // (c) Copyright 2002,2003 Ximian, Inc (http://www.ximian.com)
  8. //
  9. //
  10. // Permission is hereby granted, free of charge, to any person obtaining
  11. // a copy of this software and associated documentation files (the
  12. // "Software"), to deal in the Software without restriction, including
  13. // without limitation the rights to use, copy, modify, merge, publish,
  14. // distribute, sublicense, and/or sell copies of the Software, and to
  15. // permit persons to whom the Software is furnished to do so, subject to
  16. // the following conditions:
  17. //
  18. // The above copyright notice and this permission notice shall be
  19. // included in all copies or substantial portions of the Software.
  20. //
  21. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  22. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  24. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  25. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  26. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  27. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  28. //
  29. using System;
  30. using System.CodeDom;
  31. using System.CodeDom.Compiler;
  32. using System.Collections;
  33. using System.Collections.Specialized;
  34. using System.Reflection;
  35. using System.Text;
  36. using System.Web.UI;
  37. using System.Web.Configuration;
  38. using System.IO;
  39. namespace System.Web.Compilation
  40. {
  41. abstract class BaseCompiler
  42. {
  43. #if NET_2_0
  44. static BindingFlags replaceableFlags = BindingFlags.Public | BindingFlags.NonPublic |
  45. BindingFlags.Instance;
  46. #endif
  47. TemplateParser parser;
  48. CodeDomProvider provider;
  49. ICodeCompiler compiler;
  50. CodeCompileUnit unit;
  51. CodeNamespace mainNS;
  52. CompilerParameters compilerParameters;
  53. #if NET_2_0
  54. bool isRebuilding = false;
  55. protected Hashtable partialNameOverride = new Hashtable();
  56. protected CodeTypeDeclaration partialClass;
  57. protected CodeTypeReferenceExpression partialClassExpr;
  58. #endif
  59. protected CodeTypeDeclaration mainClass;
  60. protected CodeTypeReferenceExpression mainClassExpr;
  61. protected static CodeThisReferenceExpression thisRef = new CodeThisReferenceExpression ();
  62. protected BaseCompiler (TemplateParser parser)
  63. {
  64. compilerParameters = new CompilerParameters ();
  65. this.parser = parser;
  66. }
  67. void Init ()
  68. {
  69. unit = new CodeCompileUnit ();
  70. #if NET_2_0
  71. if (parser.IsPartial) {
  72. string ns = null;
  73. string classtype = parser.PartialClassName;
  74. if (classtype.Contains (".")) {
  75. int dot = classtype.LastIndexOf (".");
  76. ns = classtype.Substring (0, dot);
  77. classtype = classtype.Substring (dot + 1);
  78. }
  79. CodeNamespace partialNS = new CodeNamespace (ns);
  80. partialClass = new CodeTypeDeclaration (classtype);
  81. partialClass.IsPartial = true;
  82. partialClassExpr = new CodeTypeReferenceExpression (parser.PartialClassName);
  83. unit.Namespaces.Add (partialNS);
  84. partialClass.TypeAttributes = TypeAttributes.Public;
  85. partialNS.Types.Add (partialClass);
  86. }
  87. #endif
  88. mainNS = new CodeNamespace ("ASP");
  89. mainClass = new CodeTypeDeclaration (parser.ClassName);
  90. CodeTypeReference baseTypeRef;
  91. #if NET_2_0
  92. if (partialClass != null) {
  93. baseTypeRef = new CodeTypeReference (parser.PartialClassName);
  94. baseTypeRef.Options |= CodeTypeReferenceOptions.GlobalReference;
  95. } else {
  96. baseTypeRef = new CodeTypeReference (parser.BaseType.FullName);
  97. if (parser.BaseTypeIsGlobal)
  98. baseTypeRef.Options |= CodeTypeReferenceOptions.GlobalReference;
  99. }
  100. #else
  101. baseTypeRef = new CodeTypeReference (parser.BaseType.FullName);
  102. #endif
  103. mainClass.BaseTypes.Add (baseTypeRef);
  104. mainClassExpr = new CodeTypeReferenceExpression ("ASP." + parser.ClassName);
  105. unit.Namespaces.Add (mainNS);
  106. mainClass.TypeAttributes = TypeAttributes.Public;
  107. mainNS.Types.Add (mainClass);
  108. foreach (object o in parser.Imports) {
  109. if (o is string)
  110. mainNS.Imports.Add (new CodeNamespaceImport ((string) o));
  111. }
  112. // StringCollection.Contains has O(n) complexity, but
  113. // considering the number of comparisons we make on
  114. // average and the fact that using an intermediate array
  115. // would be even more costly, this is fine here.
  116. StringCollection refAsm = unit.ReferencedAssemblies;
  117. string asmName;
  118. if (parser.Assemblies != null) {
  119. foreach (object o in parser.Assemblies) {
  120. asmName = o as string;
  121. if (asmName != null && !refAsm.Contains (asmName))
  122. refAsm.Add (asmName);
  123. }
  124. }
  125. #if NET_2_0
  126. ArrayList al = WebConfigurationManager.ExtraAssemblies;
  127. if (al != null && al.Count > 0) {
  128. foreach (object o in al) {
  129. asmName = o as string;
  130. if (asmName != null && !refAsm.Contains (asmName))
  131. refAsm.Add (asmName);
  132. }
  133. }
  134. IList list = BuildManager.CodeAssemblies;
  135. if (list != null && list.Count > 0) {
  136. Assembly asm;
  137. foreach (object o in list) {
  138. asm = o as Assembly;
  139. if (o == null)
  140. continue;
  141. asmName = asm.Location;
  142. if (asmName != null && !refAsm.Contains (asmName))
  143. refAsm.Add (asmName);
  144. }
  145. }
  146. #endif
  147. // Late-bound generators specifics (as for MonoBASIC/VB.NET)
  148. unit.UserData["RequireVariableDeclaration"] = parser.ExplicitOn;
  149. unit.UserData["AllowLateBound"] = !parser.StrictOn;
  150. AddInterfaces ();
  151. AddClassAttributes ();
  152. CreateStaticFields ();
  153. AddApplicationAndSessionObjects ();
  154. AddScripts ();
  155. CreateMethods ();
  156. CreateConstructor (null, null);
  157. }
  158. #if NET_2_0
  159. internal CodeDomProvider Provider {
  160. get { return provider; }
  161. }
  162. internal CodeCompileUnit CompileUnit {
  163. get { return unit; }
  164. }
  165. #endif
  166. protected virtual void CreateStaticFields ()
  167. {
  168. CodeMemberField fld = new CodeMemberField (typeof (bool), "__initialized");
  169. fld.Attributes = MemberAttributes.Private | MemberAttributes.Static;
  170. fld.InitExpression = new CodePrimitiveExpression (false);
  171. mainClass.Members.Add (fld);
  172. }
  173. #if NET_2_0
  174. void AssignAppRelativeVirtualPath (CodeConstructor ctor)
  175. {
  176. Type baseType = parser.CodeFileBaseClassType;
  177. if (baseType == null)
  178. baseType = parser.BaseType;
  179. if (baseType == null)
  180. return;
  181. if (!baseType.IsSubclassOf (typeof (System.Web.UI.TemplateControl)))
  182. return;
  183. string arvp = Path.Combine (parser.BaseVirtualDir, Path.GetFileName (parser.InputFile));
  184. if (VirtualPathUtility.IsAbsolute (arvp))
  185. arvp = "~" + arvp;
  186. CodeExpression cast = new CodeCastExpression (baseType, new CodeThisReferenceExpression ());
  187. CodePropertyReferenceExpression arvpProp = new CodePropertyReferenceExpression (cast, "AppRelativeVirtualPath");
  188. CodeAssignStatement arvpAssign = new CodeAssignStatement ();
  189. arvpAssign.Left = arvpProp;
  190. arvpAssign.Right = new CodePrimitiveExpression (arvp);
  191. ctor.Statements.Add (arvpAssign);
  192. }
  193. #endif
  194. protected virtual void CreateConstructor (CodeStatementCollection localVars,
  195. CodeStatementCollection trueStmt)
  196. {
  197. CodeConstructor ctor = new CodeConstructor ();
  198. ctor.Attributes = MemberAttributes.Public;
  199. mainClass.Members.Add (ctor);
  200. #if NET_2_0
  201. AssignAppRelativeVirtualPath (ctor);
  202. #endif
  203. if (localVars != null)
  204. ctor.Statements.AddRange (localVars);
  205. CodeTypeReferenceExpression r;
  206. #if NET_2_0
  207. if (parser.IsPartial)
  208. r = new CodeTypeReferenceExpression (mainClass.Name);
  209. else
  210. #endif
  211. r = new CodeTypeReferenceExpression (mainNS.Name + "." + mainClass.Name);
  212. CodeFieldReferenceExpression initialized;
  213. initialized = new CodeFieldReferenceExpression (r, "__initialized");
  214. CodeBinaryOperatorExpression bin;
  215. bin = new CodeBinaryOperatorExpression (initialized,
  216. CodeBinaryOperatorType.ValueEquality,
  217. new CodePrimitiveExpression (false));
  218. CodeAssignStatement assign = new CodeAssignStatement (initialized,
  219. new CodePrimitiveExpression (true));
  220. CodeConditionStatement cond = new CodeConditionStatement (bin, assign);
  221. if (trueStmt != null)
  222. cond.TrueStatements.AddRange (trueStmt);
  223. ctor.Statements.Add (cond);
  224. }
  225. void AddScripts ()
  226. {
  227. if (parser.Scripts == null || parser.Scripts.Count == 0)
  228. return;
  229. foreach (object o in parser.Scripts) {
  230. if (o is string)
  231. mainClass.Members.Add (new CodeSnippetTypeMember ((string) o));
  232. }
  233. }
  234. protected internal virtual void CreateMethods ()
  235. {
  236. }
  237. #if NET_2_0
  238. void InternalCreatePageProperty (string retType, string name, string contextProperty)
  239. {
  240. CodeMemberProperty property = new CodeMemberProperty ();
  241. property.Name = name;
  242. property.Type = new CodeTypeReference (retType);
  243. property.Attributes = MemberAttributes.Family | MemberAttributes.Final;
  244. CodeMethodReturnStatement ret = new CodeMethodReturnStatement ();
  245. CodeCastExpression cast = new CodeCastExpression ();
  246. ret.Expression = cast;
  247. CodePropertyReferenceExpression refexp = new CodePropertyReferenceExpression ();
  248. refexp.TargetObject = new CodePropertyReferenceExpression (new CodeThisReferenceExpression (), "Context");
  249. refexp.PropertyName = contextProperty;
  250. cast.TargetType = new CodeTypeReference (retType);
  251. cast.Expression = refexp;
  252. property.GetStatements.Add (ret);
  253. if (partialClass == null)
  254. mainClass.Members.Add (property);
  255. else
  256. partialClass.Members.Add (property);
  257. }
  258. protected void CreateProfileProperty ()
  259. {
  260. string retType;
  261. ProfileSection ps = WebConfigurationManager.GetSection ("system.web/profile") as ProfileSection;
  262. if (ps != null && ps.PropertySettings.Count > 0)
  263. retType = "ProfileCommon";
  264. else
  265. retType = "System.Web.Profile.DefaultProfile";
  266. InternalCreatePageProperty (retType, "Profile", "Profile");
  267. }
  268. #endif
  269. protected virtual void AddInterfaces ()
  270. {
  271. if (parser.Interfaces == null)
  272. return;
  273. foreach (object o in parser.Interfaces) {
  274. if (o is string)
  275. mainClass.BaseTypes.Add (new CodeTypeReference ((string) o));
  276. }
  277. }
  278. protected virtual void AddClassAttributes ()
  279. {
  280. }
  281. protected virtual void AddApplicationAndSessionObjects ()
  282. {
  283. }
  284. /* Utility methods for <object> stuff */
  285. protected void CreateApplicationOrSessionPropertyForObject (Type type,
  286. string propName,
  287. bool isApplication,
  288. bool isPublic)
  289. {
  290. /* if isApplication this generates (the 'cachedapp' field is created earlier):
  291. private MyNS.MyClass app {
  292. get {
  293. if ((this.cachedapp == null)) {
  294. this.cachedapp = ((MyNS.MyClass)
  295. (this.Application.StaticObjects.GetObject("app")));
  296. }
  297. return this.cachedapp;
  298. }
  299. }
  300. else, this is for Session:
  301. private MyNS.MyClass ses {
  302. get {
  303. return ((MyNS.MyClass) (this.Session.StaticObjects.GetObject("ses")));
  304. }
  305. }
  306. */
  307. CodeExpression result = null;
  308. CodeMemberProperty prop = new CodeMemberProperty ();
  309. prop.Type = new CodeTypeReference (type);
  310. prop.Name = propName;
  311. if (isPublic)
  312. prop.Attributes = MemberAttributes.Public | MemberAttributes.Final;
  313. else
  314. prop.Attributes = MemberAttributes.Private | MemberAttributes.Final;
  315. CodePropertyReferenceExpression p1;
  316. if (isApplication)
  317. p1 = new CodePropertyReferenceExpression (thisRef, "Application");
  318. else
  319. p1 = new CodePropertyReferenceExpression (thisRef, "Session");
  320. CodePropertyReferenceExpression p2;
  321. p2 = new CodePropertyReferenceExpression (p1, "StaticObjects");
  322. CodeMethodReferenceExpression getobject;
  323. getobject = new CodeMethodReferenceExpression (p2, "GetObject");
  324. CodeMethodInvokeExpression invoker;
  325. invoker = new CodeMethodInvokeExpression (getobject,
  326. new CodePrimitiveExpression (propName));
  327. CodeCastExpression cast = new CodeCastExpression (prop.Type, invoker);
  328. if (isApplication) {
  329. CodeFieldReferenceExpression field;
  330. field = new CodeFieldReferenceExpression (thisRef, "cached" + propName);
  331. CodeConditionStatement stmt = new CodeConditionStatement();
  332. stmt.Condition = new CodeBinaryOperatorExpression (field,
  333. CodeBinaryOperatorType.IdentityEquality,
  334. new CodePrimitiveExpression (null));
  335. CodeAssignStatement assign = new CodeAssignStatement ();
  336. assign.Left = field;
  337. assign.Right = cast;
  338. stmt.TrueStatements.Add (assign);
  339. prop.GetStatements.Add (stmt);
  340. result = field;
  341. } else {
  342. result = cast;
  343. }
  344. prop.GetStatements.Add (new CodeMethodReturnStatement (result));
  345. mainClass.Members.Add (prop);
  346. }
  347. protected string CreateFieldForObject (Type type, string name)
  348. {
  349. string fieldName = "cached" + name;
  350. CodeMemberField f = new CodeMemberField (type, fieldName);
  351. f.Attributes = MemberAttributes.Private;
  352. mainClass.Members.Add (f);
  353. return fieldName;
  354. }
  355. protected void CreatePropertyForObject (Type type, string propName, string fieldName, bool isPublic)
  356. {
  357. CodeFieldReferenceExpression field = new CodeFieldReferenceExpression (thisRef, fieldName);
  358. CodeMemberProperty prop = new CodeMemberProperty ();
  359. prop.Type = new CodeTypeReference (type);
  360. prop.Name = propName;
  361. if (isPublic)
  362. prop.Attributes = MemberAttributes.Public | MemberAttributes.Final;
  363. else
  364. prop.Attributes = MemberAttributes.Private | MemberAttributes.Final;
  365. CodeConditionStatement stmt = new CodeConditionStatement();
  366. stmt.Condition = new CodeBinaryOperatorExpression (field,
  367. CodeBinaryOperatorType.IdentityEquality,
  368. new CodePrimitiveExpression (null));
  369. CodeObjectCreateExpression create = new CodeObjectCreateExpression (prop.Type);
  370. stmt.TrueStatements.Add (new CodeAssignStatement (field, create));
  371. prop.GetStatements.Add (stmt);
  372. prop.GetStatements.Add (new CodeMethodReturnStatement (field));
  373. mainClass.Members.Add (prop);
  374. }
  375. /******/
  376. void CheckCompilerErrors (CompilerResults results)
  377. {
  378. if (results.NativeCompilerReturnValue == 0)
  379. return;
  380. string fileText = null;
  381. CompilerErrorCollection errors = results.Errors;
  382. CompilerError ce = (errors != null && errors.Count > 0) ? errors [0] : null;
  383. string inFile = (ce != null) ? ce.FileName : null;
  384. if (inFile != null && File.Exists (inFile))
  385. fileText = File.ReadAllText (inFile);
  386. else {
  387. StringWriter writer = new StringWriter();
  388. provider.CreateGenerator().GenerateCodeFromCompileUnit (unit, writer, null);
  389. fileText = writer.ToString ();
  390. }
  391. throw new CompilationException (parser.InputFile, errors, fileText);
  392. }
  393. protected string DynamicDir ()
  394. {
  395. return AppDomain.CurrentDomain.SetupInformation.DynamicBase;
  396. }
  397. [MonoTODO ("find out how to extract the warningLevel and compilerOptions in the <system.codedom> case")]
  398. public virtual Type GetCompiledType ()
  399. {
  400. Type type = CachingCompiler.GetTypeFromCache (parser.InputFile);
  401. if (type != null)
  402. return type;
  403. Init ();
  404. string lang = parser.Language;
  405. #if NET_2_0
  406. CompilationSection config = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
  407. Compiler comp = config.Compilers[lang];
  408. string compilerOptions = "";
  409. int warningLevel = 0;
  410. if (comp == null) {
  411. CompilerInfo info = CodeDomProvider.GetCompilerInfo (lang);
  412. if (info != null && info.IsCodeDomProviderTypeValid)
  413. provider = info.CreateProvider ();
  414. // XXX there's no way to get
  415. // warningLevel or compilerOptions out
  416. // of the provider.. they're in the
  417. // configuration section, though.
  418. }
  419. else {
  420. Type t = Type.GetType (comp.Type, true);
  421. provider = Activator.CreateInstance (t) as CodeDomProvider;
  422. compilerOptions = comp.CompilerOptions;
  423. warningLevel = comp.WarningLevel;
  424. }
  425. #else
  426. CompilationConfiguration config;
  427. config = CompilationConfiguration.GetInstance (parser.Context);
  428. provider = config.GetProvider (lang);
  429. string compilerOptions = config.GetCompilerOptions (lang);
  430. int warningLevel = config.GetWarningLevel (lang);
  431. #endif
  432. if (provider == null)
  433. throw new HttpException ("Configuration error. Language not supported: " +
  434. lang, 500);
  435. compiler = provider.CreateCompiler ();
  436. compilerParameters.IncludeDebugInformation = parser.Debug;
  437. compilerParameters.CompilerOptions = compilerOptions + " " + parser.CompilerOptions;
  438. compilerParameters.WarningLevel = warningLevel;
  439. bool keepFiles = (Environment.GetEnvironmentVariable ("MONO_ASPNET_NODELETE") != null);
  440. string tempdir = config.TempDirectory;
  441. if (tempdir == null || tempdir == "")
  442. tempdir = DynamicDir ();
  443. TempFileCollection tempcoll = new TempFileCollection (tempdir, keepFiles);
  444. compilerParameters.TempFiles = tempcoll;
  445. string dllfilename = Path.GetFileName (tempcoll.AddExtension ("dll", true));
  446. compilerParameters.OutputAssembly = Path.Combine (DynamicDir (), dllfilename);
  447. CompilerResults results = CachingCompiler.Compile (this);
  448. CheckCompilerErrors (results);
  449. Assembly assembly = results.CompiledAssembly;
  450. if (assembly == null) {
  451. if (!File.Exists (compilerParameters.OutputAssembly)) {
  452. results.TempFiles.Delete ();
  453. throw new CompilationException (parser.InputFile, results.Errors,
  454. "No assembly returned after compilation!?");
  455. }
  456. assembly = Assembly.LoadFrom (compilerParameters.OutputAssembly);
  457. }
  458. results.TempFiles.Delete ();
  459. Type mainClassType = assembly.GetType (mainClassExpr.Type.BaseType, true);
  460. #if NET_2_0
  461. if (parser.IsPartial) {
  462. // With the partial classes, we need to make sure we
  463. // don't have any methods that should have not been
  464. // created (because they are accessible from the base
  465. // types). We cannot do this normally because the
  466. // codebehind file is actually a partial class and we
  467. // have no way of identifying the partial class' base
  468. // type until now.
  469. if (!isRebuilding && CheckPartialBaseType (mainClassType)) {
  470. isRebuilding = true;
  471. parser.RootBuilder.ResetState ();
  472. return GetCompiledType ();
  473. }
  474. }
  475. #endif
  476. return mainClassType;
  477. }
  478. #if NET_2_0
  479. internal bool IsRebuildingPartial
  480. {
  481. get { return isRebuilding; }
  482. }
  483. internal bool CheckPartialBaseType (Type type)
  484. {
  485. // Get the base type. If we don't have any (bad thing), we
  486. // don't need to replace ourselves. Also check for the
  487. // core file, since that won't have any either.
  488. Type baseType = type.BaseType;
  489. if (baseType == null || baseType == typeof(System.Web.UI.Page))
  490. return false;
  491. bool rebuild = false;
  492. if (CheckPartialBaseFields (type, baseType))
  493. rebuild = true;
  494. if (CheckPartialBaseProperties (type, baseType))
  495. rebuild = true;
  496. return rebuild;
  497. }
  498. internal bool CheckPartialBaseFields (Type type, Type baseType)
  499. {
  500. bool rebuild = false;
  501. foreach (FieldInfo baseInfo in baseType.GetFields (replaceableFlags)) {
  502. if (baseInfo.IsPrivate)
  503. continue;
  504. FieldInfo typeInfo = type.GetField (baseInfo.Name, replaceableFlags);
  505. if (typeInfo != null && typeInfo.DeclaringType == type) {
  506. partialNameOverride [typeInfo.Name] = true;
  507. rebuild = true;
  508. }
  509. }
  510. return rebuild;
  511. }
  512. internal bool CheckPartialBaseProperties (Type type, Type baseType)
  513. {
  514. bool rebuild = false;
  515. foreach (PropertyInfo baseInfo in baseType.GetProperties ()) {
  516. PropertyInfo typeInfo = type.GetProperty (baseInfo.Name);
  517. if (typeInfo != null && typeInfo.DeclaringType == type) {
  518. partialNameOverride [typeInfo.Name] = true;
  519. rebuild = true;
  520. }
  521. }
  522. return rebuild;
  523. }
  524. #endif
  525. internal CompilerParameters CompilerParameters {
  526. get { return compilerParameters; }
  527. }
  528. internal CodeCompileUnit Unit {
  529. get { return unit; }
  530. }
  531. internal virtual ICodeCompiler Compiler {
  532. get { return compiler; }
  533. }
  534. internal TemplateParser Parser {
  535. get { return parser; }
  536. }
  537. }
  538. }