public CompilationState(ErrorManager errMgr, string name, ITokenStream tokens)
 {
     this.errMgr = errMgr;
     this.tokens = tokens;
     impl.Name = name;
     impl.Prefix = Utility.GetPrefix(name);
 }
 public static TemplateVisualizer Visualize(this Template template, ErrorManager errorManager, CultureInfo culture, int lineWidth)
 {
     ErrorBuffer errors = new ErrorBuffer();
     template.impl.NativeGroup.Listener = errors;
     StringWriter @out = new StringWriter();
     ITemplateWriter wr = new AutoIndentWriter(@out);
     wr.LineWidth = lineWidth;
     Interpreter interp = new Interpreter(template.Group, culture, true);
     TemplateFrame frame = new TemplateFrame(template, null);
     interp.Execute(wr, frame); // Render and track events
     TemplateVisualizer visualizer = new TemplateVisualizer(errorManager, frame, @out.ToString(), interp, interp.GetExecutionTrace(), errors.Errors);
     visualizer.Show();
     return visualizer;
 }
        public TemplateVisualizer(ErrorManager errorManager, TemplateFrame root, string output, Interpreter interpreter, List<string> trace, ReadOnlyCollection<TemplateMessage> errors)
        {
            if (errorManager == null)
                throw new ArgumentNullException("errorManager");
            if (root == null)
                throw new ArgumentNullException("root");
            if (interpreter == null)
                throw new ArgumentNullException("interpreter");
            if (trace == null)
                throw new ArgumentNullException("trace");
            if (errors == null)
                throw new ArgumentNullException("errors");

            _errorManager = errorManager;
            _root = root;
            _output = output;
            _interpreter = interpreter;
            _trace = trace;
            _errors = errors;
        }
Exemple #4
0
 public TemplateLexer(ErrorManager errMgr, ICharStream input, IToken templateToken, char delimiterStartChar, char delimiterStopChar)
 {
     this.errMgr = errMgr;
     this.input = input;
     c = (char)input.LA(1); // prime lookahead
     this.templateToken = templateToken;
     this.delimiterStartChar = delimiterStartChar;
     this.delimiterStopChar = delimiterStopChar;
 }
Exemple #5
0
 public TemplateLexer(ErrorManager errMgr, ICharStream input, IToken templateToken)
     : this(errMgr, input, templateToken, '<', '>')
 {
 }
Exemple #6
0
        public Interpreter(TemplateGroup group, CultureInfo culture, ErrorManager errorManager, bool debug)
        {
            if (errorManager == null)
                throw new ArgumentNullException("errorManager");

            this.group = group;
            this.culture = culture;
            this._errorManager = errorManager;
            this._debug = debug;
            if (debug)
            {
                events = new List<InterpEvent>();
                executeTrace = new List<string>();
            }
        }
Exemple #7
0
 public Interpreter(TemplateGroup group, ErrorManager errorManager, bool debug)
     : this(group, CultureInfo.CurrentCulture, errorManager, debug)
 {
 }
 public TemplateParser(ITokenStream input, ErrorManager errMgr, IToken templateToken)
     : this(input)
 {
     this.errMgr = errMgr;
     this.templateToken = templateToken;
 }
 public TemplateLexerNoNewlines(ErrorManager errMgr, ICharStream input, IToken templateToken, char delimiterStartChar, char delimiterStopChar)
     : base(errMgr, input, templateToken, delimiterStartChar, delimiterStopChar)
 {
 }