Пример #1
0
		public Lexer(TextReader reader, LexerMemento state) : base(reader, state)
		{
			if (!(state is VBLexerMemento))
				throw new InvalidOperationException("state must be a VBLexerState");
			
			var vbState = state as VBLexerMemento;
			ef = new ExpressionFinder(vbState.ExpressionFinder);
			lineEnd = vbState.LineEnd;
			isAtLineBegin = vbState.IsAtLineBegin;
			encounteredLineContinuation = vbState.EncounteredLineContinuation;
			misreadExclamationMarkAsTypeCharacter = vbState.MisreadExclamationMarkAsTypeCharacter;
			xmlModeStack = new Stack<XmlModeInfo>(vbState.XmlModeInfoStack.Select(i => (XmlModeInfo)i.Clone()).Reverse());
			inXmlMode = vbState.InXmlMode;
		}
        public static Parser.ILexer CreateLexer(SupportedLanguage language, TextReader textReader, LexerMemento state)
        {
            switch (language)
            {
            case SupportedLanguage.CSharp:
                //return new ICSharpCode.NRefactory.Parser.CSharp.Lexer(textReader, state);
                throw new System.NotSupportedException("C# Lexer does not support loading a previous state.");

            case SupportedLanguage.VBNet:
                return(new ICSharpCode.NRefactory.Parser.VB.Lexer(textReader, state));
            }
            throw new System.NotSupportedException(language + " not supported.");
        }
Пример #3
0
        public static Parser.ILexer CreateLexer(TextReader textReader, LexerMemento state)
        {
            return(new VelerSoftware.SZC.VBNetParser.Parser.VB.Lexer(textReader, state));

            throw new System.NotSupportedException("VBNet not supported.");
        }