示例#1
0
        public override BaseNode VisitGrid(CoronaParser.GridContext context)
        {
            // Create gridNode
            GridNode node = new GridNode(new List <MemberNode>());

            // Extract and visit gridnode children
            BuildMemberAst memberVisitor = new BuildMemberAst();

            foreach (CoronaParser.GridDeclarationContext d in context.gridDeclaration())
            {
                node.Members.Add(memberVisitor.Visit(d));
            }

            return(node);
        }
示例#2
0
        public override BaseNode VisitStates(CoronaParser.StatesContext context)
        {
            StatesNode node = new StatesNode(new List <string>(), new List <MemberNode>());

            //Get the ids for the states
            foreach (var id in context.ID())
            {
                node.Labels.Add(id.GetText());
            }

            // Extract and visit StateNode children
            BuildMemberAst memberVisitor = new BuildMemberAst();

            foreach (CoronaParser.MemberDeclarationContext member in context.memberDeclaration())
            {
                node.Members.Add(memberVisitor.Visit(member));
            }

            return(node);
        }