コード例 #1
0
        private void CallRoutineTY(out GoProperty currentGoProperty)
        {
            switch (_iterator.Current.TokenType)
            {
            case TokenType.Array:
                MatchToken(TokenType.Array);
                CallRoutineTY(out GoProperty childGoProperty);
                GoArray currentGoArray = new GoArray();
                currentGoArray.ArrayProperty = childGoProperty;
                currentGoProperty            = currentGoArray;
                break;

            case TokenType.Int:
                MatchToken(TokenType.Int);
                currentGoProperty = new GoInt();
                break;

            case TokenType.String:
                MatchToken(TokenType.String);
                currentGoProperty = new GoString();
                break;

            case TokenType.Float64:
                MatchToken(TokenType.Float64);
                currentGoProperty = new GoFloat();
                break;

            case TokenType.Bool:
                MatchToken(TokenType.Bool);
                currentGoProperty = new GoBool();
                break;

            case TokenType.Id:
                var dslMatch             = MatchToken(TokenType.Id);
                var currentGoPropertyKey = dslMatch.Value;
                currentGoProperty = new GoTypeKey(currentGoPropertyKey, dslMatch.LineNumber);
                break;

            case TokenType.Struct:
                MatchToken(TokenType.Struct);
                MatchToken(TokenType.StructLeftKey);
                CallRoutineSTR(out GoStruct goStructProperty);
                currentGoProperty = goStructProperty;
                MatchToken(TokenType.StructRightKey);
                break;

            default:
                throw new System.Exception("Invalid property token");
            }
        }
コード例 #2
0
 public void IsPropertyDefined(GoArray goArray)
 {
     goArray.ArrayProperty.FailIfUndefinedInParser(this);
 }
コード例 #3
0
 public void AddGoPropertyToNavigationQueue(GoArray goArray, Queue <GoObject> navigationQueue)
 {
     goArray.ArrayProperty.AddToTypeNavigationQueue(navigationQueue, this);
 }
コード例 #4
0
 public void NavigateDependenciesInto(GoArray goArray, Stack <GoObject> pathTaken)
 {
     goArray.ArrayProperty.NavigateDependenciesTo(pathTaken, this);
 }