protected DeclaredSymbol(ISymbolContext context, string name, SyntaxBase declaringSyntax, IdentifierSyntax nameSyntax) : base(name) { this.Context = context; this.DeclaringSyntax = declaringSyntax; this.NameSyntax = nameSyntax; }
public Binder(BicepFile bicepFile, ISymbolContext symbolContext) { // TODO use lazy or some other pattern for init this.bicepFile = bicepFile; this.TargetScope = SyntaxHelper.GetTargetScope(bicepFile); var(declarations, outermostScopes) = DeclarationVisitor.GetDeclarations(bicepFile, symbolContext); var uniqueDeclarations = GetUniqueDeclarations(declarations); var builtInNamespaces = GetBuiltInNamespaces(this.TargetScope); this.bindings = GetBindings(bicepFile, uniqueDeclarations, builtInNamespaces, outermostScopes); this.cyclesBySymbol = GetCyclesBySymbol(bicepFile, this.bindings); // TODO: Avoid looping 5 times? this.FileSymbol = new FileSymbol( bicepFile.FileUri.LocalPath, bicepFile.ProgramSyntax, builtInNamespaces, outermostScopes, declarations.OfType <ParameterSymbol>(), declarations.OfType <VariableSymbol>(), declarations.OfType <ResourceSymbol>(), declarations.OfType <ModuleSymbol>(), declarations.OfType <OutputSymbol>(), bicepFile.FileUri); }
public Binder(INamespaceProvider namespaceProvider, BicepFile bicepFile, ISymbolContext symbolContext) { // TODO use lazy or some other pattern for init this.bicepFile = bicepFile; this.TargetScope = SyntaxHelper.GetTargetScope(bicepFile); var(declarations, outermostScopes) = DeclarationVisitor.GetDeclarations(namespaceProvider, TargetScope, bicepFile, symbolContext); var uniqueDeclarations = GetUniqueDeclarations(declarations); this.NamespaceResolver = GetNamespaceResolver(namespaceProvider, this.TargetScope, uniqueDeclarations); this.bindings = NameBindingVisitor.GetBindings(bicepFile.ProgramSyntax, uniqueDeclarations, NamespaceResolver, outermostScopes); this.cyclesBySymbol = GetCyclesBySymbol(bicepFile, this.bindings); this.FileSymbol = new FileSymbol( bicepFile.FileUri.LocalPath, bicepFile.ProgramSyntax, NamespaceResolver, outermostScopes, declarations, bicepFile.FileUri); }
public Binder(SyntaxTree syntaxTree, ISymbolContext symbolContext) { // TODO use lazy or some other pattern for init this.syntaxTree = syntaxTree; this.TargetScope = SyntaxHelper.GetTargetScope(syntaxTree); var allDeclarations = GetAllDeclarations(syntaxTree, symbolContext); var uniqueDeclarations = GetUniqueDeclarations(allDeclarations); var builtInNamespacs = GetBuiltInNamespaces(this.TargetScope); this.bindings = GetBindings(syntaxTree, uniqueDeclarations, builtInNamespacs); this.cyclesBySymbol = GetCyclesBySymbol(syntaxTree, uniqueDeclarations, this.bindings); // TODO: Avoid looping 5 times? this.FileSymbol = new FileSymbol( syntaxTree.FileUri.LocalPath, syntaxTree.ProgramSyntax, builtInNamespacs, allDeclarations.OfType <ParameterSymbol>(), allDeclarations.OfType <VariableSymbol>(), allDeclarations.OfType <ResourceSymbol>(), allDeclarations.OfType <ModuleSymbol>(), allDeclarations.OfType <OutputSymbol>()); }
public ResourceSymbol(ISymbolContext context, string name, ResourceDeclarationSyntax declaringSyntax, SyntaxBase body) : base(context, name, declaringSyntax, declaringSyntax.Name) { this.Body = body; }
public VariableSymbol(ISymbolContext context, string name, VariableDeclarationSyntax declaringSyntax, SyntaxBase value) : base(context, name, declaringSyntax, declaringSyntax.Name) { this.Value = value; }
public ParameterSymbol(ISymbolContext context, string name, ParameterDeclarationSyntax declaringSyntax, SyntaxBase?modifier) : base(context, name, declaringSyntax, declaringSyntax.Name) { this.Modifier = modifier; }
public OutputSymbol(ISymbolContext context, string name, OutputDeclarationSyntax declaringSyntax, SyntaxBase value) : base(context, name, declaringSyntax, declaringSyntax.Name) { this.Value = value; }
public ResourceSymbol(ISymbolContext context, string name, ResourceDeclarationSyntax declaringSyntax) : base(context, name, declaringSyntax, declaringSyntax.Name) { }
public DeclarationVisitor(ISymbolContext context, IList <DeclaredSymbol> declaredSymbols) { this.context = context; this.declaredSymbols = declaredSymbols; }
private static ImmutableArray <DeclaredSymbol> GetAllDeclarations(SyntaxTree syntaxTree, ISymbolContext symbolContext) { // collect declarations var declarations = new List <DeclaredSymbol>(); var declarationVisitor = new DeclarationVisitor(symbolContext, declarations); declarationVisitor.Visit(syntaxTree.ProgramSyntax); return(declarations.ToImmutableArray()); }
public LocalVariableSymbol(ISymbolContext context, string name, LocalVariableSyntax declaringSyntax) : base(context, name, declaringSyntax, declaringSyntax.Name) { }
public ImportedNamespaceSymbol(ISymbolContext context, string name, TypeSymbol declaredType, ImportDeclarationSyntax declaringSyntax) : base(context, name, declaringSyntax, declaringSyntax.Name) { DeclaredType = declaredType; }
public ModuleSymbol(ISymbolContext context, string name, ModuleDeclarationSyntax declaringSyntax) : base(context, name, declaringSyntax, declaringSyntax.Name) { }
public LocalVariableSymbol(ISymbolContext context, string name, LocalVariableSyntax declaringSyntax, LocalKind localKind) : base(context, name, declaringSyntax, declaringSyntax.Name) { this.LocalKind = localKind; }
public ParameterSymbol(ISymbolContext context, string name, ParameterDeclarationSyntax declaringSyntax) : base(context, name, declaringSyntax, declaringSyntax.Name) { }