Exemplo n.º 1
0
        public DependencyPass.DependencyTracker GetDemoTracker2(ProtoCore.Core core)
        {
            Associative.Scanner s = new Associative.Scanner(@"..\..\Scripts\expr.ds");
            Associative.Parser  p = new Associative.Parser(s, core);
            p.Parse();

            CodeBlockNode code = p.codeblock as CodeBlockNode;

            DependencyTracker tempTracker           = new DependencyTracker();
            Dictionary <string, List <Node> > names = new Dictionary <string, List <Node> >();

            code.ConsolidateNames(ref (names));
            tempTracker.GenerateDependencyGraph(code.Body);
            return(tempTracker);
        }
Exemplo n.º 2
0
        public DependencyPass.DependencyTracker GetDemoTracker3(out ProtoCore.DSASM.SymbolTable symbols, string pathFilename, ProtoCore.Core core)
        {
            Associative.Scanner s = new Associative.Scanner(pathFilename);
            Associative.Parser  p = new Associative.Parser(s, core);
            p.Parse();
            CodeBlockNode code = p.codeblock as CodeBlockNode;

            symbols = code.symbols;

            DependencyTracker tempTracker = new DependencyTracker();

#if TEST_DIRECT
            foreach (Node node in code.Body)
            {
                tempTracker.AllNodes.Add(node);
            }
#else
            Dictionary <string, List <Node> > names = new Dictionary <string, List <Node> >();
            code.ConsolidateNames(ref (names));
            tempTracker.GenerateDependencyGraph(code.Body);
#endif
            return(tempTracker);
        }
Exemplo n.º 3
0
	void FunctionalMethodBodyMultiLine(out Node funcBody) {
		CodeBlockNode functionBody = new CodeBlockNode(); 
		NodeList body = new NodeList(); 
		
		Expect(32);
		StatementList(out body);
		functionBody = new CodeBlockNode(); 
		functionBody.Body =body;  
		Expect(33);
		funcBody = functionBody; 
	}
Exemplo n.º 4
0
        void HydrogenParser()
        {
            codeblock = new CodeBlockNode();
            Node node = null;
            while (StartOf(1)) {
            if (la.kind == 1 || la.kind == 20 || la.kind == 48) {
                Statement(out node);
            } else if (la.kind == 25 || la.kind == 26) {
                functiondecl(out node);
            } else if (la.kind == 23) {
                classdecl(out node);
            } else {
                LanguageBlock(out node);
            }
            if (null != node)
            (codeblock as CodeBlockNode).Body.Add(node);

            }
        }