コード例 #1
0
 public Parser(StreamReader stream)
 {
     lexer = new Lexer(stream);
 }
コード例 #2
0
 public Parser(StreamReader stream)
 {
     lexer = new Lexer(stream);
 }
コード例 #3
0
 public Parser(Lexer Lexer)
 {
     this.Lexer = Lexer;
 }
コード例 #4
0
        public object Read(TextReader Reader, string Source)
        {
            LispRootAttribute RootAttrib = (LispRootAttribute)
                Attribute.GetCustomAttribute(RootType, typeof(LispRootAttribute));
            if(RootAttrib == null)
                throw new LispException("Type needs to have LispRoot attribute");

            Lexer Lexer = new Lexer(Reader);
            Parser Parser = new Parser(Lexer);

            List Root = Parser.Parse();
            Properties RootP = new Properties(Root);

            List List = null;
            if(!RootP.Get(RootAttrib.Name, ref List))
                throw new LispException("'" + Source + "' is not a " + RootAttrib.Name + " file");

            return ReadType(RootType, List);
        }