Ejemplo n.º 1
0
 public LanguageCompiler(GrammarData data)
 {
     Data = data;
       Grammar = data.Grammar;
       Parser = new Parser(Data);
       Scanner = new Scanner(Data);
 }
Ejemplo n.º 2
0
 public override void Init(Grammar grammar)
 {
     base.Init(grammar);
       if (string.IsNullOrEmpty(QuickParseTerminators))
     QuickParseTerminators = grammar.WhitespaceChars + grammar.Delimiters;
       _defaultFloatTypes = new TypeCode[] { DefaultFloatType };
 }
Ejemplo n.º 3
0
 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");
       }
 }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
 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
 }
Ejemplo n.º 6
0
 public override void Init(Grammar grammar)
 {
     _quickParseTerminators = grammar.WhitespaceChars + grammar.Delimiters;
       base.Init(grammar);
 }
Ejemplo n.º 7
0
 public virtual void Init(Grammar grammar)
 {
 }