public void IsPropertyDefined(GoTypeKey goObjKey) { if (!_contentInstance.ContainsKey(goObjKey.KeyValue)) { throw new ParserUndefinedObjectTypeReferenceException(goObjKey); } }
public void NavigateDependenciesInto(GoTypeKey goTypeKey, Stack <GoObject> pathTaken) { if (pathTaken.Any(obj => obj.ObjectType == goTypeKey.KeyValue)) { throw new ParserDependencyCycleException(pathTaken.Peek(), goTypeKey, _contentInstance[goTypeKey.KeyValue]); } pathTaken.Push(_contentInstance[goTypeKey.KeyValue]); TraverseDependencies(pathTaken); pathTaken.Pop(); }
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"); } }
public void AddGoPropertyToNavigationQueue(GoTypeKey goTypeKey, Queue <GoObject> navigationQueue) { navigationQueue.Enqueue(_contentInstance[goTypeKey.KeyValue]); }
public ParserUndefinedObjectTypeReferenceException(GoTypeKey goObjKey) : base(string.Empty) { this.goObjKey = goObjKey; this.ParserExceptionMessage = $"Referencia en la propiedad en la linea {goObjKey.LineDefinition} de nombre \"{goObjKey.KeyValue}\". Este tipo se encuentra indefinido."; }