edu.vub.at.objects.grammar
Interface Import
Import
The public interface to a native AST component of the form
'import (alias (symbol := symbol)+)? (exclude symbol (, symbol)*)?'
Examples:
'import o' => (import (symbol o) (table) (table))
'import o alias foo := bar' => (import (symbol o) (table (table (symbol foo) (symbol bar))) (table))
'import o exclude foo, bar:' => (import (symbol o) (table) (table (symbol foo) (symbol bar:)))
'import o alias a: := b, c := d: exclude e, f =>
(import (symbol o) (table (table (sym a:) (sym b)) (table (sym c) (sym d:))) (table (sym e) (sym f)))
- Author:
- tvcutsem
Methods inherited from interface edu.vub.at.objects.Object |
super |
importedObjectExpression
Expression importedObjectExpression()
- Example:
`{ import o }.statements[1].importedObjectExpression == `o
- Returns:
- the expression that should evaluate to the object to import.
aliasedSymbols
Expression aliasedSymbols()
- Example:
`{ import o alias foo := bar }.statements[1].aliasedSymbols == `[[foo, bar]]
- Returns:
- a table of pairs (tables of size two) of symbols that defines the mapping of symbols to alias.
excludedSymbols
Expression excludedSymbols()
- Example:
`{ import o exclude a, b }.statements[1].excludedSymbols == `[a,b]
- Returns:
- a table of symbols that represent the symbols to be excluded from the imported object.