lingua-franca 0.10.1
Lingua Franca code generator
Loading...
Searching...
No Matches
org.lflang.scoping.LFGlobalScopeProvider Class Reference

Global scope provider that limits access to only those files that were explicitly imported. More...

Inherits ImportUriGlobalScopeProvider.

Public Member Functions

Set< Resource > getImportedResources (Resource resource)
 Return the resources imported by the given resource.

Protected Member Functions

Set< Resource > getImportedResources (Resource resource, LinkedHashSet< URI > uniqueImportURIs)
 Return the resources imported by a given resource, excluding those already discovered and therefore are present in the given set of import URIs.
LinkedHashSet< URI > getImportedUris (Resource resource)
 Return the set of URI objects pointing to the resources that must be included for compilation.
URI resolve (String uriStr, Resource resource)
 Resolve a resource identifier.

Static Package Attributes

static final String IMPORTED_RESOURCES = "IMPORTED_RESOURCES"
static final String IMPORTED_URIS = "IMPORTED_URIS"
static final Splitter SPLITTER = Splitter.on(LFResourceDescriptionStrategy.DELIMITER)
 Splitter used to process user-data annotations of Model nodes.

Detailed Description

Global scope provider that limits access to only those files that were explicitly imported.

Adapted from Xtext manual, Chapter 8.7.

Author
Marten Lohstroh
See also
xtext doc

Member Function Documentation

◆ getImportedResources() [1/2]

Set< Resource > org.lflang.scoping.LFGlobalScopeProvider.getImportedResources ( Resource resource)

Return the resources imported by the given resource.

◆ getImportedResources() [2/2]

Set< Resource > org.lflang.scoping.LFGlobalScopeProvider.getImportedResources ( Resource resource,
LinkedHashSet< URI > uniqueImportURIs )
protected

Return the resources imported by a given resource, excluding those already discovered and therefore are present in the given set of import URIs.

Parameters
resourceThe resource to analyze.
uniqueImportURIsThe set of discovered import URIs

◆ getImportedUris()

LinkedHashSet< URI > org.lflang.scoping.LFGlobalScopeProvider.getImportedUris ( Resource resource)
protected

Return the set of URI objects pointing to the resources that must be included for compilation.

Collect unique URIs in case the cache is not populated yet.

Helper method to recursively collect unique URIs.

◆ resolve()

URI org.lflang.scoping.LFGlobalScopeProvider.resolve ( String uriStr,
Resource resource )
protected

Resolve a resource identifier.

Parameters
uriStrresource identifier to resolve.
resourceresource to (initially) resolve it relative to.

Member Data Documentation

◆ IMPORTED_RESOURCES

final String org.lflang.scoping.LFGlobalScopeProvider.IMPORTED_RESOURCES = "IMPORTED_RESOURCES"
staticpackage

◆ IMPORTED_URIS

final String org.lflang.scoping.LFGlobalScopeProvider.IMPORTED_URIS = "IMPORTED_URIS"
staticpackage

◆ SPLITTER

final Splitter org.lflang.scoping.LFGlobalScopeProvider.SPLITTER = Splitter.on(LFResourceDescriptionStrategy.DELIMITER)
staticpackage

Splitter used to process user-data annotations of Model nodes.


The documentation for this class was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/scoping/LFGlobalScopeProvider.java