public BVE5Resolver(BVE5Compilation compilation, SimpleTypeResolveContext context, Dictionary<string, ResolveResult> nameLookupCache, ImmutableStack<IVariable> stack) { this.compilation = compilation; this.context = context; user_defined_name_lookup_cache = nameLookupCache; local_variable_stack = stack; }
public BVE5Resolver(BVE5Compilation compilation) { if(compilation == null) throw new ArgumentNullException("compilation"); this.compilation = compilation; this.context = new SimpleTypeResolveContext(compilation.MainAssembly); }
public BVE5Resolver(SimpleTypeResolveContext context) { if(context == null) throw new ArgumentNullException("context"); this.compilation = (BVE5Compilation)context.Compilation; this.context = context; if(context.CurrentTypeDefinition != null) user_defined_name_lookup_cache = new Dictionary<string, ResolveResult>(); }
/// <summary> /// Creates a new BVE5 AST resolver. /// Use this overload if you are resolving within a complete BVE5 file. /// </summary> /// <param name="compilation">The current compilation.</param> /// <param name="syntaxTree">The syntax tree to be resolved.</param> /// <param name="unresolvedFile"> /// Optional: Result of <see cref="SyntaxTree.ToTypeSystem()"/> for the file being resolved. /// <para> /// This is used for setting up the context on the resolver. The unresolved file must be registered in the compilation. /// </para> /// <para> /// When the unresolvedFile is specified, the resolver will use the member's StartLocation/EndLocation to identify /// member declarations in the AST with members in the type system. /// When no unresolvedFile is specified (<c>null</c> value for this parameter), the resolver will instead compare the /// member's signature in the AST with the signature in the type system. /// </para> /// </param> public BVE5AstResolver(BVE5Compilation compilation, SyntaxTree syntaxTree, BVE5UnresolvedFile unresolvedFile = null) { if(compilation == null) throw new ArgumentNullException("compilation"); if(syntaxTree == null) throw new ArgumentNullException("syntaxTree"); initial_resolver_state = new BVE5Resolver(compilation); root_node = syntaxTree; unresolved_file = unresolvedFile; resolve_visitor = new ResolveVisitor(initial_resolver_state, unresolvedFile, FileKindHelper.GetTypeNameFromFileKind(syntaxTree.Kind)); }
static BVE5LanguageBinding() { project = new BVE5ProjectContent().AddAssemblyReferences(BVEBuiltins.GetBuiltinAssembly()) as BVE5ProjectContent; compilation = project.CreateCompilation() as BVE5Compilation; }
public ICompilation CreateCompilation() { var snapshot = new DefaultSolutionSnapshot(); var compilation = new BVE5Compilation(snapshot, this, assembly_references); snapshot.AddCompilation(this, compilation); return compilation; }