示例#1
0
 public CompilationState(ErrorManager errMgr, string name, ITokenStream tokens)
 {
     this.errMgr = errMgr;
     this.tokens = tokens;
     impl.Name = name;
     impl.Prefix = Utility.GetPrefix(name);
 }
示例#2
0
 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;
 }
示例#3
0
        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;
        }
示例#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;
 }
示例#5
0
 public TemplateLexer(ErrorManager errMgr, ICharStream input, IToken templateToken)
     : this(errMgr, input, templateToken, '<', '>')
 {
 }
示例#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>();
            }
        }
示例#7
0
 public Interpreter(TemplateGroup group, ErrorManager errorManager, bool debug)
     : this(group, CultureInfo.CurrentCulture, errorManager, debug)
 {
 }
示例#8
0
 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)
 {
 }