예제 #1
0
 public void AddIdentifier(AstIdentifier identifier)
 {
     if (!TryAddIdentifier(identifier))
     {
         throw new InvalidOperationException(
                   "Identifier is already set, null or no Site could be found.");
     }
 }
예제 #2
0
        public ArgumentT?LookupArgument(AstIdentifier parameterName)
        {
            var parameter = FindByName(_parameters, parameterName.CanonicalFullName);

            if (parameter is not null)
            {
                return(LookupArgument(parameter));
            }
            return(null);
        }
예제 #3
0
        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));
        }
예제 #4
0
        public override bool TrySetIdentifier(AstIdentifier identifier)
        {
            var success = base.TrySetIdentifier(identifier);

            if (success)
            {
                SymbolTable.SetName(identifier.SymbolName.CanonicalName.FullName);
            }

            return(success);
        }
예제 #5
0
        public AstTypeDefinitionIntrinsic(AstIdentifier identifier, Type?systemType,
                                          AstTemplateParameterDefinition?templateParameter = null)
        {
            this.SetIdentifier(identifier);
            SystemType = systemType;

            if (templateParameter is not null)
            {
                this.AddTemplateParameter(templateParameter);
            }
        }
예제 #6
0
 protected bool TrySetIdentifier(AstIdentifier identifier, AstIdentifierKind matchKind)
 {
     Ast.Guard(identifier.IdentifierKind == matchKind, $"Identifier must be of kind {matchKind}");
     return(Ast.SafeSet(ref _identifier, identifier));
 }
예제 #7
0
 public virtual bool TrySetIdentifier(AstIdentifier identifier)
 => TrySetIdentifier(identifier, AstIdentifierKind.Variable);
예제 #8
0
 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));
 }
예제 #10
0
 protected AstIdentifier(AstIdentifier identifierToCopy)
 {
     Context        = identifierToCopy.Context;
     IdentifierKind = identifierToCopy.IdentifierKind;
     SymbolName     = new AstSymbolName(identifierToCopy.SymbolName);
 }
예제 #11
0
 public AstTypeReferenceType(AstIdentifier identifier)
 {
     this.SetIdentifier(identifier);
 }
예제 #12
0
 public virtual bool TrySetIdentifier(AstIdentifier identifier)
 {
     Ast.Guard(identifier.IdentifierKind == AstIdentifierKind.Type, "Identifier must be of kind Type");
     return(Ast.SafeSet(ref _identifier, identifier));
 }
예제 #13
0
 public virtual bool TrySetIdentifier(AstIdentifier identifier)
 => TrySetIdentifier(identifier, AstIdentifierKind.Field);
예제 #14
0
 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);
 }