From 31ce3adc19a70236fc53d57dd3c03e4ad683a7dc Mon Sep 17 00:00:00 2001 From: Kevin Glynn Date: Fri, 7 Jan 2011 16:13:20 +0100 Subject: [PATCH] Move AppEnv into CommonWalker --- .../antlr3/src/cs2j/CSharp/CommonWalker.cs | 12 ++++++++++-- .../antlr3/src/cs2j/CSharp/TemplateExtracter.g | 5 ----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CSharpTranslator/antlr3/src/cs2j/CSharp/CommonWalker.cs b/CSharpTranslator/antlr3/src/cs2j/CSharp/CommonWalker.cs index 60dda89..fabadc9 100644 --- a/CSharpTranslator/antlr3/src/cs2j/CSharp/CommonWalker.cs +++ b/CSharpTranslator/antlr3/src/cs2j/CSharp/CommonWalker.cs @@ -5,12 +5,20 @@ using System.Text; using Antlr.Runtime.Tree; using Antlr.Runtime; +using RusticiSoftware.Translator.Utils; +using RusticiSoftware.Translator.CLR; + namespace RusticiSoftware.Translator.CSharp { public class CommonWalker : TreeParser { - public CS2JSettings Cfg { get; set; } - public string Filename { get; set; } + public CS2JSettings Cfg { get; set; } + public string Filename { get; set; } + + // AppEnv contains a summary of the environment within which we are translating, it maps fully qualified type names to their + // translation templates (i.e. a description of their public features) + public DirectoryHT AppEnv {get; set;} + protected CommonWalker(ITreeNodeStream input, RecognizerSharedState state) : base(input, state) diff --git a/CSharpTranslator/antlr3/src/cs2j/CSharp/TemplateExtracter.g b/CSharpTranslator/antlr3/src/cs2j/CSharp/TemplateExtracter.g index d12a4fa..72ded17 100644 --- a/CSharpTranslator/antlr3/src/cs2j/CSharp/TemplateExtracter.g +++ b/CSharpTranslator/antlr3/src/cs2j/CSharp/TemplateExtracter.g @@ -29,16 +29,11 @@ scope NSContext { using System.Text; using System.Linq; using RusticiSoftware.Translator.CLR; - using RusticiSoftware.Translator.Utils; } @members { - // This is the environment that we are building, it maps fully qualified type names to their - // translation templates - public DirectoryHT AppEnv {get; set;} - protected UseRepTemplate[] NameSpaceContext { get { // We return the elements in source order (hopefully less confusing)