コード例 #1
0
ファイル: Parser.cs プロジェクト: CSRedRat/pascalabcnet
 public void Reset()
 {
     grammar_stream = CGTResourceExtractor.Extract(new ResourceManager("PascalABCParser.Preprocessor_2.PABCPreprocessor2Lang", Assembly.GetExecutingAssembly()), "PABCPreprocessor2Language");
 	parser = new GPB_PABCPreprocessor2(grammar_stream,null);
                 
     max_errors = 5;
 }
コード例 #2
0
ファイル: Parser.cs プロジェクト: CSRedRat/pascalabcnet
        public PascalPreprocessor2LanguageParser()
		{         
            this.filesExtensions = new string[1];
            this.filesExtensions[0] = ".paspr2" + Parsers.Controller.HideParserExtensionPostfixChar;
            parser = null;
		}
コード例 #3
0
ファイル: Parser.cs プロジェクト: CSRedRat/pascalabcnet
 public syntax_tree_node BuildTree(string FileName, string Text, ParseMode parseMode)
 {
     if (this.parser == null)
         Reset();
     GPB_PABCPreprocessor2 parser = new GPB_PABCPreprocessor2(this.grammar_stream, this.parser.LanguageGrammar, this.parser.prepr);
     parser.errors = Errors;
     parser.current_file_name = FileName;
     compilerDirectives = new List<compiler_directive>();
     parser.CompilerDirectives = compilerDirectives;
     switch (parseMode)
     {
         case ParseMode.Expression:
         case ParseMode.Statement:
             return null;
     }
     syntax_tree_node cu = (syntax_tree_node)parser.Parse(Text);
     if (cu != null && cu is compilation_unit)
     {
         (cu as compilation_unit).file_name = FileName;
         (cu as compilation_unit).compiler_directives = compilerDirectives;
     }
     return cu;
 }