Beispiel #1
0
        private void ParseRestrictedInterfaceDeclaration(ParserContext context)
        {
            var node = context.FieldContainer as ProtoNode;

            if (node == null)
            {
                throw new Exception("Unexpected context");
            }
            var accessType = context.ReadNextToken().Text;

            switch (accessType)
            {
            case "eventIn":
                var fieldInType = ParseFieldType(context);
                var eventInId   = ParseEventInId(context);
                //TODO: process interface eventIn declaration.
                break;

            case "eventOut":
                var fieldOutType = ParseFieldType(context);
                var eventOutId   = ParseEventOutId(context);
                //TODO: process interface eventOut declaration.
                break;

            case "field":
                var fieldType = ParseFieldType(context);
                var fieldId   = ParseFieldId(context);
                var field     = context.CreateField(fieldType);
                node.AddField(fieldId, field);
                field.AcceptVisitor(_fieldParser);
                //TODO: process interface field declaration.
                break;

            default:
                throw new Exception("Unexpected context");
            }
        }
 private void ParseRestrictedInterfaceDeclaration(ParserContext context) {
     var node = context.FieldContainer as ProtoNode;
     if (node == null) throw new Exception("Unexpected context");
     var accessType = context.ReadNextToken().Text;
     switch (accessType) {
         case "eventIn":
             var fieldInType = ParseFieldType(context);
             var eventInId = ParseEventInId(context);
             //TODO: process interface eventIn declaration.
             break;
         case "eventOut":
             var fieldOutType = ParseFieldType(context);
             var eventOutId = ParseEventOutId(context);
             //TODO: process interface eventOut declaration.
             break;
         case "field":
             var fieldType = ParseFieldType(context);
             var fieldId = ParseFieldId(context);
             var field = context.CreateField(fieldType);
             node.AddField(fieldId, field);
             field.AcceptVisitor(_fieldParser);
             //TODO: process interface field declaration.
             break;
         default:
             throw new Exception("Unexpected context");
     }
 }