예제 #1
0
파일: CharReader.cs 프로젝트: hultqvist/lax
        public CharReader(CodeSegment statement)
        {
            this.statement = statement;
            this.code = statement.Code;
            HasData = true;

            offset = -1;
            NextChar();
        }
예제 #2
0
        public static TokenStream Read(CodeSegment code)
        {
            var r = new TokenReader(code);
            var list = new List<Token>();
            while (true)
            {
                var t = r.NextToken();
                if (t.Type == TokenType.EndOfStream)
                    break;

                list.Add(t);
            }
            return new TokenStream(list);
        }
예제 #3
0
 TokenReader(CodeSegment code)
 {
     StartPoint = code.CodePosition;
     reader = new CharReader(code);
 }