Esempio n. 1
0
        public void Parse(string file_path)
        {
            Source source  = new Source(file_path);
            var    scanner = new PascalScanner(source);
            var    parser  = new PascalParser(scanner);

            parser.Parse();
        }
Esempio n. 2
0
 static void Main(string[] args)
 {
     //Path to file should be in args
     if (args.Length != 0)
     {
         var parser = new PascalParser(args[0]);
         parser.Parse();
     }
 }
Esempio n. 3
0
        public override TypeLibrary Load(IPlatform platform, TypeLibrary dstLib)
        {
            var rdr          = new StreamReader(new MemoryStream(bytes));
            var lexer        = new PascalLexer(rdr, false); // It seems MPW pascal doesn't allow nesting comments.
            var parser       = new PascalParser(lexer);
            var symbolTable  = new SymbolTable(platform);
            var declarations = parser.Parse();
            var tldser       = new TypeLibraryDeserializer(platform, true, dstLib);
            var constants    = EvaluateConstants(declarations);
            var typeImporter = new TypeImporter(platform, tldser, constants, dstLib);

            typeImporter.LoadTypes(declarations);
            LoadServices(declarations, typeImporter, constants, platform, dstLib);
            return(dstLib);
        }