コード例 #1
0
ファイル: NamespaceDeclarations.cs プロジェクト: tupipa/vcc
 internal void Parse(Parsing.Parser parser, VccCompilationPart compilationPart)
 {
     this.Parse(parser);
     this.compilationPart = compilationPart;
     this.SetContainingNodes();
     this.isInitialized = true;
 }
コード例 #2
0
 public EditorAdapter(LanguageData language)
 {
     _parser          = new Parsing.Parser(language);
     _scanner         = _parser.Scanner;
     _colorizerThread = new Thread(ColorizerLoop);
     _colorizerThread.IsBackground = true;
     _parserThread = new Thread(ParserLoop);
     _parserThread.IsBackground = true;
 }
コード例 #3
0
ファイル: NamespaceDeclarations.cs プロジェクト: tupipa/vcc
        //^ invariant isInitialized ==> this.members != null;

        private void Parse(Parsing.Parser parser)
        //^ ensures this.members != null;
        {
            List <INamespaceDeclarationMember> members = this.members = new List <INamespaceDeclarationMember>();

            parser.ParseCompilationUnit(this.CompilationPart.GlobalDeclarationContainer, members);
            members.TrimExcess();
            //^ assume this.members != null;
        }
コード例 #4
0
 private void miRemoveAll_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to remove all grammmars in the list?",
                         "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         cboGrammars.Items.Clear();
         _parser = null;
     }
 }
コード例 #5
0
ファイル: DataRecordProfile.cs プロジェクト: Mixi59/Stump
        public override void ExecuteProfile(Parsing.Parser parser)
        {
            if (parser.Fields.All(x => x.Name != "MODULE") && parser.Class.Heritage != "Item")
            {
                return;
            }

            base.ExecuteProfile(parser);
        }
コード例 #6
0
        private void CreateParser()
        {
            StopHighlighter();
            btnRun.Enabled = false;
            txtOutput.Text = string.Empty;
            _parseTree     = null;

            btnRun.Enabled = _grammar.FlagIsSet(LanguageFlags.CanRunSample);
            _language      = _grammar.CreateLanguageData();
            _parser        = new Parsing.Parser(_language);
            ShowParserConstructionResults();
            StartHighlighter();
        }
コード例 #7
0
 private void miRemove_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to remove grammmar " + cboGrammars.SelectedItem + "?",
                         "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         cboGrammars.Items.RemoveAt(cboGrammars.SelectedIndex);
         _parser = null;
         if (cboGrammars.Items.Count > 0)
         {
             cboGrammars.SelectedIndex = 0;
         }
     }
 }
コード例 #8
0
 public LogViewModel()
 {
     this.eventAggregator       = IoC.Get <IEventAggregator>();
     this.defaultParser         = new Parsing.Parser();
     this.ColumnConfig          = new ColumnConfig();
     this.logEntries            = new BindableCollection <LogEntry>();
     this.logEntriesView        = CollectionViewSource.GetDefaultView(this.logEntries);
     this.logEntriesView.Filter = LogEntriesFilter;
     this.culture = CultureInfo.InvariantCulture;
     this.refreshViewOnFilterChange = true;
     this.selectedDetailPanelKey    = null;
     this.showErrorMessage          = false;
 }
コード例 #9
0
ファイル: LazyValue.cs プロジェクト: rmpChurill/MathParser
        public LazyValue(string expression, CalculationContext context)
        {
            this.context            = context;
            this.lastRequestWasType = false;
            this.rawExpression      = expression;
            this.dirty = true;
            var tokenizer = new Tokenizing.Tokenizer(expression, context.Config);

            tokenizer.Run();
            var parser = new Parsing.Parser(tokenizer.Tokens, context.Config);

            this.evaluator = new PostFixEvaluator(parser.CreatePostFixExpression(), context);

            this.BindEvents();
        }
コード例 #10
0
 public StaccatoParserContext(Parsing.Parser parser)
 {
     Parser = parser;
 }
コード例 #11
0
ファイル: Compiler.cs プロジェクト: TheCommieDuck/OldProjects
        static void Main(string[] args)
        {
            if (1 == 0)
            {
            }
            else
            {
                Console.WriteLine("File to compile:");
                string file = Console.ReadLine();
                CodeGen gen = new CodeGen(file.Substring(0, file.LastIndexOf('.'))+".exe");
                if (args.Length == 100)
                    Fail();//we screwed up; no args
                else
                {
                    Console.WriteLine("Compilation started.");
                    string source = null;

                    if (args.Length >= 2)
                    {
                        switch (args[1])
                        {
                            case "-verbose":
                                {
                                    Compiler.Verbose = true;
                                    break;
                                }
                            default:
                                {
                                    Fail();
                                    break;
                                }

                        }
                    }

                    try
                    {
                        source = File.ReadAllText(file);
                    }
                    catch (IOException)
                    {
                        Console.WriteLine("Could not find or open {0}", file);
                        //WELL damn
                        Fail();
                    }

                    string sourceCode = "Define Void WriteLine(String sa): End. Define Void WriteLine(Int i): End." +
                        "Define Void Write(String sa): End. Define String ReadLine(): Return \"dummy\". End. " +
                        "Define Void WaitForInput(): String r = ReadLine(). End. " + source;

                    Lexer lexer = new Lexer(sourceCode);
                    lexer.GenerateTokenLists();
                    lexer.TokenList.Add(new Token(TokenType.EOF, null, lexer.TokenList.List.Last().LineNo + 1));
                    Parsing.Parser parser = new Parsing.Parser(lexer);
                    Node tree = parser.Parse();

                    //errors; don't start generating code
                    if (ErrorHandler.ErrorCount != 0)
                    {
                        ErrorHandler.End();
                    }

                    Console.WriteLine("Parsing successful");
                    gen.GenerateCode((RootNode)tree);
                    gen.FinalizeGeneration();
                    int i = 1;
                    Console.ReadLine();
                }
            }
        }