public void AddIdentifier(AstIdentifier identifier) { if (!TryAddIdentifier(identifier)) { throw new InvalidOperationException( "Identifier is already set, null or no Site could be found."); } }
public ArgumentT?LookupArgument(AstIdentifier parameterName) { var parameter = FindByName(_parameters, parameterName.CanonicalFullName); if (parameter is not null) { return(LookupArgument(parameter)); } return(null); }
public override bool TrySetIdentifier(AstIdentifier identifier) { if (identifier.IsIntrinsic) { // self (parameter) is the only intrinsic that can be referenced in variable. return(TrySetIdentifier(identifier, AstIdentifierKind.Parameter)); } return(base.TrySetIdentifier(identifier)); }
public override bool TrySetIdentifier(AstIdentifier identifier) { var success = base.TrySetIdentifier(identifier); if (success) { SymbolTable.SetName(identifier.SymbolName.CanonicalName.FullName); } return(success); }
public AstTypeDefinitionIntrinsic(AstIdentifier identifier, Type?systemType, AstTemplateParameterDefinition?templateParameter = null) { this.SetIdentifier(identifier); SystemType = systemType; if (templateParameter is not null) { this.AddTemplateParameter(templateParameter); } }
protected bool TrySetIdentifier(AstIdentifier identifier, AstIdentifierKind matchKind) { Ast.Guard(identifier.IdentifierKind == matchKind, $"Identifier must be of kind {matchKind}"); return(Ast.SafeSet(ref _identifier, identifier)); }
public virtual bool TrySetIdentifier(AstIdentifier identifier) => TrySetIdentifier(identifier, AstIdentifierKind.Variable);
public AstFunctionParameterDefinition(AstIdentifier identifier) : base(null) { this.SetIdentifier(identifier); IsSelf = identifier.IsEqual(AstIdentifierIntrinsic.Self); }
public bool TrySetIdentifier(AstIdentifier identifier) { Ast.Guard(identifier.IdentifierKind == AstIdentifierKind.TemplateParameter, "Identifier must be of kind TemplateParameter"); return(Ast.SafeSet(ref _identifier, identifier)); }
protected AstIdentifier(AstIdentifier identifierToCopy) { Context = identifierToCopy.Context; IdentifierKind = identifierToCopy.IdentifierKind; SymbolName = new AstSymbolName(identifierToCopy.SymbolName); }
public AstTypeReferenceType(AstIdentifier identifier) { this.SetIdentifier(identifier); }
public virtual bool TrySetIdentifier(AstIdentifier identifier) { Ast.Guard(identifier.IdentifierKind == AstIdentifierKind.Type, "Identifier must be of kind Type"); return(Ast.SafeSet(ref _identifier, identifier)); }
public virtual bool TrySetIdentifier(AstIdentifier identifier) => TrySetIdentifier(identifier, AstIdentifierKind.Field);
public bool TrySetIdentifier(AstIdentifier identifier) { Ast.Guard(identifier.IdentifierKind == AstIdentifierKind.Function, "Identifier must be of kind Function"); return(Ast.SafeSet(ref _identifier, identifier)); }
public override bool TrySetIdentifier(AstIdentifier identifier) => TrySetIdentifier(identifier, AstIdentifierKind.EnumOption);
public AstTemplateParameterDefinition(AstIdentifier identifier) { this.SetIdentifier(identifier); }
public AstGenericParameterDefinition(AstIdentifier identifier) { this.SetIdentifier(identifier); }