コード例 #1
0
ファイル: Lexer.cs プロジェクト: Netring/SharpDevelop
		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;
		}
コード例 #2
0
        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.");
        }