public Lexicon() { m_tokenList = new List <TokenInfo>(); m_lexerStates = new List <LexerState>(); m_defaultState = new LexerState(this, 0); m_lexerStates.Add(m_defaultState); }
internal TokenInfo(RegularExpression definition, Lexicon lexicon, LexerState state, Token tag) { Lexicon = lexicon; Definition = definition; State = state; Tag = tag; }
public Lexicon() { m_tokenList = new List<Token>(); m_lexerStates = new List<LexerState>(); m_defaultState = new LexerState(this, 0); m_lexerStates.Add(m_defaultState); }
internal LexerState DefineLexerState(LexerState baseState) { int index = m_lexerStates.Count; LexerState newState = new LexerState(this, index, baseState); m_lexerStates.Add(newState); return(newState); }
internal TokenInfo AddToken(RegularExpression definition, LexerState state, int indexInState, string description) { int index = m_tokenList.Count; Token tag = new Token(index, description ?? definition.ToString()); TokenInfo token = new TokenInfo(definition, this, state, tag); m_tokenList.Add(token); return(token); }
internal LexerState(Lexicon lexicon, int index, LexerState baseState) { Children = new List<LexerState>(); Lexicon = lexicon; BaseState = baseState; m_tokens = new List<Token>(); Index = index; if (baseState == null) { Level = 0; } else { Level = baseState.Level + 1; baseState.Children.Add(this); } }
internal LexerState(Lexicon lexicon, int index, LexerState baseState) { Children = new List <LexerState>(); Lexicon = lexicon; BaseState = baseState; m_tokens = new List <TokenInfo>(); Index = index; if (baseState == null) { Level = 0; } else { Level = baseState.Level + 1; baseState.Children.Add(this); } }
internal LexerState DefineLexerState(LexerState baseState) { int index = m_lexerStates.Count; LexerState newState = new LexerState(this, index, baseState); m_lexerStates.Add(newState); return newState; }
internal Token AddToken(RegularExpression definition, LexerState state, int indexInState, string description) { int index = m_tokenList.Count; Token token = new Token(definition, this, index, state, description); m_tokenList.Add(token); return token; }