public LanguageCompiler(GrammarData data) { Data = data; Grammar = data.Grammar; Parser = new Parser(Data); Scanner = new Scanner(Data); }
public override void Init(Grammar grammar) { base.Init(grammar); if (string.IsNullOrEmpty(QuickParseTerminators)) QuickParseTerminators = grammar.WhitespaceChars + grammar.Delimiters; _defaultFloatTypes = new TypeCode[] { DefaultFloatType }; }
public override void Init(Grammar grammar) { base.Init(grammar); //_endSymbolsFirsts char array is used for fast search for end symbols using String's method IndexOfAny(...) _endSymbolsFirsts = new char[EndSymbols.Count]; for (int i = 0; i < EndSymbols.Count; i++) { string sym = EndSymbols[i]; _endSymbolsFirsts[i] = sym[0]; _isLineComment |= sym.Contains("\n"); } }
public override void Init(Grammar grammar) { base.Init(grammar); //collect all start-end symbols in lists and create strings of first chars for both _startEndSymbols.Clear(); _startEndSymbols.AddRange(StartEndSymbolTable.Keys); _startEndSymbols.Sort(StringList.LongerFirst); _startEndFirsts = string.Empty; foreach (string st in _startEndSymbols) _startEndFirsts += st[0]; if (IsSet(TermOptions.SpecialIgnoreCase)) _startEndFirsts = _startEndFirsts.ToLower() + _startEndFirsts.ToUpper(); }
public LanguageCompiler(Grammar grammar) { Grammar = grammar; #if !SILVERLIGHT Stopwatch sw = new Stopwatch(); sw.Start(); #endif GrammarDataBuilder bld = new GrammarDataBuilder(grammar); bld.Build(); Data = bld.Data; Parser = new Parser(Data); Scanner = new Scanner(Data); #if !SILVERLIGHT sw.Stop(); InitTime = sw.ElapsedMilliseconds; #endif }
public override void Init(Grammar grammar) { _quickParseTerminators = grammar.WhitespaceChars + grammar.Delimiters; base.Init(grammar); }
public virtual void Init(Grammar grammar) { }