Ejemplo n.º 1
0
        /// <summary>
        /// Parses a P syntax tree to C#.
        /// </summary>
        /// <param name="tree">SyntaxTree</param>
        private void ParsePSyntaxTree(SyntaxTree tree)
        {
            var root = (CompilationUnitSyntax)tree.GetRoot();

            var tokens  = new PLexer().Tokenize(root.ToFullString());
            var program = new PParser(this, tree).ParseTokens(tokens);

            this.PPrograms.Add(program as PProgram);
            this.ProgramMap.Add(program, tree);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Parses a P syntax tree to C#.
        /// </summary>
        /// <param name="tree">SyntaxTree</param>
        private void ParsePSyntaxTree(SyntaxTree tree)
        {
            var root = (CompilationUnitSyntax)tree.GetRoot();

            var tokens = new PLexer().Tokenize(root.ToFullString());
            var program = new PParser(this, tree).ParseTokens(tokens);

            this.PPrograms.Add(program as PProgram);
            this.ProgramMap.Add(program, tree);
        }