示例#1
0
        public IState GetNext(char c)
        {
            if (IdentifierState.IsIdentifierChar(c))
            {
                return(null);
            }

            if (char.IsWhiteSpace(c))
            {
                return(new WhitespaceState());
            }

            if (c == '{')
            {
                return(new OpenBraceState());
            }

            if (c == ':')
            {
                return(new ColonState());
            }

            if (c == ';')
            {
                return(new SemiColonState());
            }

            throw new TokenizerException(c, "Identifier");
        }
示例#2
0
        public IState GetNext(char c)
        {
            if (char.IsWhiteSpace(c))
            {
                return(new WhitespaceState());
            }

            if (IdentifierState.IsIdentifierChar(c))
            {
                return(new IdentifierState());
            }

            throw new TokenizerException(c, "CloseBrace");
        }