コード例 #1
0
        public Lexicon()
        {
            m_tokenList    = new List <TokenInfo>();
            m_lexerStates  = new List <LexerState>();
            m_defaultState = new LexerState(this, 0);

            m_lexerStates.Add(m_defaultState);
        }
コード例 #2
0
        internal TokenInfo(RegularExpression definition, Lexicon lexicon, LexerState state, Token tag)
        {
            Lexicon    = lexicon;
            Definition = definition;
            State      = state;

            Tag = tag;
        }
コード例 #3
0
ファイル: Lexicon.cs プロジェクト: zhoufoxcn/VBF
        public Lexicon()
        {
            m_tokenList = new List<Token>();
            m_lexerStates = new List<LexerState>();
            m_defaultState = new LexerState(this, 0);

            m_lexerStates.Add(m_defaultState);
        }
コード例 #4
0
ファイル: TokenInfo.cs プロジェクト: jiangzhen/VBF
        internal TokenInfo(RegularExpression definition, Lexicon lexicon, LexerState state, Token tag)
        {
            Lexicon = lexicon;
            Definition = definition;
            State = state;

            Tag = tag;
        }
コード例 #5
0
        internal LexerState DefineLexerState(LexerState baseState)
        {
            int        index    = m_lexerStates.Count;
            LexerState newState = new LexerState(this, index, baseState);

            m_lexerStates.Add(newState);

            return(newState);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
ファイル: LexerState.cs プロジェクト: zhoufoxcn/VBF
        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);
            }
        }
コード例 #8
0
ファイル: LexerState.cs プロジェクト: lzyzsd/VBF
        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);
            }
        }
コード例 #9
0
ファイル: Lexicon.cs プロジェクト: zhoufoxcn/VBF
        internal LexerState DefineLexerState(LexerState baseState)
        {
            int index = m_lexerStates.Count;
            LexerState newState = new LexerState(this, index, baseState);
            m_lexerStates.Add(newState);

            return newState;
        }
コード例 #10
0
ファイル: Lexicon.cs プロジェクト: zhoufoxcn/VBF
        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;
        }