public override IToken NextToken()
        {
            IToken token = base.NextToken();

            switch (token.Type)
            {
            case CONTINUE_COMMENT:
                Mode = GoClassifierLexerMode.GoCodeComment;
                token.Type = ML_COMMENT;
                break;

            case END_COMMENT:
                Mode = GoClassifierLexerMode.GoCode;
                token.Type = ML_COMMENT;
                break;

            case CONTINUE_STRING:
                Mode = GoClassifierLexerMode.GoCodeString;
                token.Type = RAW_STRING_LITERAL;
                break;

            case END_STRING:
                Mode = GoClassifierLexerMode.GoCode;
                token.Type = RAW_STRING_LITERAL;
                break;

            default:
                break;
            }

            return token;
        }
Example #2
0
        public override IToken NextToken()
        {
            IToken token = base.NextToken();

            switch (token.Type)
            {
            case CONTINUE_COMMENT:
                Mode       = GoClassifierLexerMode.GoCodeComment;
                token.Type = ML_COMMENT;
                break;

            case END_COMMENT:
                Mode       = GoClassifierLexerMode.GoCode;
                token.Type = ML_COMMENT;
                break;

            case CONTINUE_STRING:
                Mode       = GoClassifierLexerMode.GoCodeString;
                token.Type = RAW_STRING_LITERAL;
                break;

            case END_STRING:
                Mode       = GoClassifierLexerMode.GoCode;
                token.Type = RAW_STRING_LITERAL;
                break;

            default:
                break;
            }

            return(token);
        }
Example #3
0
        public GoClassifierLexer([NotNull] ICharStream input, GoClassifierLexerState state)
        {
            Requires.NotNull(input, nameof(input));

            _input         = input;
            _languageLexer = new GoColorizerLexer(input, this);

            _mode = state.Mode;
        }
        public GoClassifierLexer(ICharStream input, GoClassifierLexerState state)
        {
            Contract.Requires <ArgumentNullException>(input != null, "input");

            _input         = input;
            _languageLexer = new GoColorizerLexer(input, this);

            _mode = state.Mode;
        }
 public GoClassifierLexerState(GoClassifierLexerMode mode)
 {
     Mode = mode;
 }