コード例 #1
0
 public void Visit(ExitsTypeNodeNode exitsTypeNodeNode)
 {
 }
コード例 #2
0
ファイル: AstPrinter.cs プロジェクト: chhoumann/p4
 public void Visit(ExitsTypeNodeNode exitsTypeNodeNode)
 {
     sb.AppendLine("Exit");
 }
コード例 #3
0
        public GameObjectContentNode VisitGameObjectContent(DazelParser.GameObjectContentContext context)
        {
            GameObjectContentTypeNode gameObjectContentTypeNode;

            switch (context.gameObjectContentType.Type)
            {
            case DazelLexer.MAP:
                gameObjectContentTypeNode = new MapTypeNode()
                {
                    Token = context.Start
                };
                break;

            case DazelLexer.ONSCREENENTERED:
                gameObjectContentTypeNode = new OnScreenEnteredTypeNode()
                {
                    Token = context.Start
                };
                break;

            case DazelLexer.ENTITIES:
                gameObjectContentTypeNode = new EntitiesTypeNodeNode()
                {
                    Token = context.Start
                };
                break;

            case DazelLexer.EXITS:
                gameObjectContentTypeNode = new ExitsTypeNodeNode()
                {
                    Token = context.Start
                };
                break;

            case DazelLexer.DATA:
                gameObjectContentTypeNode = new DataTypeNodeNode()
                {
                    Token = context.Start
                };
                break;

            case DazelLexer.PATTERN:
                gameObjectContentTypeNode = new PatternTypeNode()
                {
                    Token = context.Start
                };
                break;

            default:
                throw new ArgumentException("Invalid content type.");
            }

            GameObjectContentNode contentNode = new GameObjectContentNode()
            {
                Token      = context.Start,
                Statements = VisitStatementBlock(context.statementBlock()),
                TypeNode   = gameObjectContentTypeNode,
            };

            return(contentNode);
        }