Package | Description |
---|---|
gololang |
Provides the top-level Golo support classes.
|
gololang.ir |
Java package for golo IR tree elements.
|
org.eclipse.golo.compiler |
Provides access to the Golo compiler and supporting classes.
|
org.eclipse.golo.compiler.macro |
Provides support to hygienic compilation macros.
|
Modifier and Type | Method and Description |
---|---|
static GoloElement<?> |
Predefined.contextual(GoloFunction fun)
Macro to define a contextual macro.
|
static GoloElement<?> |
Predefined.special(GoloFunction fun)
Macro to define a special macro.
|
Modifier and Type | Method and Description |
---|---|
static void |
Messages.error(java.lang.Object message,
GoloElement<?> node)
Prints an error message to standard error with information from given IR node.
|
static void |
Messages.info(java.lang.Object message,
GoloElement<?> node)
Prints an info message to standard error with information from given IR node.
|
static void |
Messages.printPrefixedWithPosition(java.lang.String prefix,
java.lang.Object message,
GoloElement<?> node,
java.lang.String color) |
static void |
Messages.warning(java.lang.Object message,
GoloElement<?> node)
Prints a warning to standard error with information from given IR node.
|
Modifier and Type | Interface and Description |
---|---|
interface |
Alternatives<T extends GoloElement<?>>
Alternative nodes, such as `match` or `case`.
|
class |
GoloElement<T extends GoloElement<T>>
Generic IR tree Element.
|
class |
WhenClause<T extends GoloElement<?>> |
Modifier and Type | Class and Description |
---|---|
class |
AbstractInvocation<T extends AbstractInvocation<T>>
Abstract representation of a Golo invocation in the IR tree.
|
class |
AssignmentStatement
Assignment statement in Golo code.
|
class |
Augmentation
"classical" augmentation.
|
class |
BinaryOperation
Represents a binary operation.
|
class |
Block
Represent a block, that is a sequence of statements.
|
class |
CaseStatement
A
case node. |
class |
ClosureReference
A closure reference.
|
class |
CollectionComprehension
Represents a collection comprehension expression.
|
class |
CollectionLiteral
Represents a collection literal.
|
class |
ConditionalBranching
Represents a conditional branching.
|
class |
ConstantStatement
A constant value.
|
class |
Decorator
A function decorator.
|
class |
DestructuringAssignment
A destructuring assignment.
|
class |
ExpressionStatement<T extends ExpressionStatement<T>> |
class |
ForEachLoopStatement
Represents a
foreach loop on an iterator. |
class |
FunctionInvocation
Represents a function call.
|
class |
GoloAssignment<T extends GoloAssignment<T>> |
class |
GoloFunction
Represents a function declaration.
|
class |
GoloModule |
class |
GoloStatement<T extends GoloStatement<T>> |
class |
GoloType<T extends GoloType<T>> |
class |
LocalReference
Represents a reference.
|
class |
LoopBreakFlowStatement |
class |
LoopStatement
Generic looping structure.
|
class |
MacroInvocation |
class |
MatchExpression
A
match node. |
class |
Member |
class |
MethodInvocation
Represent a method invocation on an expression.
|
class |
ModuleImport
An import of a Golo or Java module, class or package.
|
class |
NamedArgument
A named argument in a function call.
|
class |
NamedAugmentation
Named augmentation definition.
|
class |
Noop
Empty IR node.
|
class |
ReferenceLookup
A reference lookup in the golo code.
|
class |
ReturnStatement |
class |
Struct
Represents a
struct element. |
class |
ThrowStatement |
class |
ToplevelElements
A container of top-level
GoloElement . |
class |
TryCatchFinally
A
try catch finally statement. |
class |
TypeWithMembers<T extends TypeWithMembers<T>>
An abstract class for struct-like types.
|
class |
UnaryOperation |
class |
Union
Represents a
union element. |
class |
UnionValue |
class |
WhenClause<T extends GoloElement<?>> |
Modifier and Type | Method and Description |
---|---|
<C extends GoloElement<?>> |
GoloElement.ancestorOfType(java.lang.Class<C> cls)
Returns the first ancestor of this node being an instance of the given class.
|
protected <C extends GoloElement<?>> |
GoloElement.makeParentOf(C childElement) |
Modifier and Type | Method and Description |
---|---|
GoloElement<?> |
GoloElement.ancestor(FunctionReference predicate)
Returns the first ancestor of this node matching the given predicate.
|
GoloElement<?> |
GoloElement.ancestor(java.util.function.Predicate<GoloElement<?>> predicate)
Returns the first ancestor of this node matching the given predicate.
|
GoloElement<?> |
GoloModule.getSubtypeByName(java.lang.String name) |
GoloElement<?> |
GoloElement.next()
Returns the next sibling of this element.
|
GoloElement<?> |
GoloElement.next(FunctionReference predicate)
Returns the next sibling of this element matching the given predicate.
|
GoloElement<?> |
GoloElement.next(java.util.function.Predicate<GoloElement<?>> predicate)
Returns the next sibling of this element matching the given predicate.
|
GoloElement<?> |
GoloElement.parent() |
GoloElement<?> |
GoloElement.previous()
Returns the previous sibling of this element.
|
GoloElement<?> |
GoloElement.previous(FunctionReference predicate)
Returns the previous sibling of this element matching the given predicate.
|
GoloElement<?> |
GoloElement.previous(java.util.function.Predicate<GoloElement<?>> predicate)
Returns the previous sibling of this element matching the given predicate.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<GoloElement<?>> |
Augmentation.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
UnaryOperation.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
ThrowStatement.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
TypeWithMembers.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
CollectionComprehension.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
Union.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
WhenClause.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
BinaryOperation.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
ClosureReference.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
ConditionalBranching.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
ForEachLoopStatement.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
NamedAugmentation.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
Decorator.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
MatchExpression.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
GoloAssignment.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
GoloElement.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
LoopStatement.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
TryCatchFinally.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
GoloFunction.children() |
java.util.List<GoloElement<?>> |
AbstractInvocation.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
CollectionLiteral.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
CaseStatement.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
ToplevelElements.children() |
java.util.List<GoloElement<?>> |
ReturnStatement.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
NamedArgument.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
Block.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
GoloModule.children()
Returns a list of all the direct children of this node.
|
java.util.List<GoloElement<?>> |
GoloElement.children(FunctionReference predicate)
Returns a iterable on the direct children of this node matching the given predicate.
|
java.util.List<GoloElement<?>> |
GoloElement.children(java.util.function.Predicate<GoloElement<?>> predicate)
Returns a list the direct children of this node matching the given predicate.
|
java.util.stream.Stream<GoloElement<?>> |
GoloElement.descendants() |
java.util.List<GoloElement<?>> |
GoloElement.descendants(FunctionReference predicate)
Returns a list of all the descendants of this node matching the given predicate.
|
java.util.List<GoloElement<?>> |
GoloElement.descendants(java.util.function.Predicate<GoloElement<?>> predicate)
Returns a list of all the descendants of this node matching the given predicate.
|
java.util.List<GoloElement<?>> |
AbstractInvocation.getArguments() |
java.util.Iterator<GoloElement<?>> |
ToplevelElements.iterator() |
Modifier and Type | Method and Description |
---|---|
GoloModule |
GoloModule.add(GoloElement<?> element) |
boolean |
Union.addElement(GoloElement<?> elt)
Adds a value or a macro invocation according to the given argument.
|
java.lang.Object |
Visitors.DispatchIrVisitor.apply(java.lang.Object acc,
GoloElement<?> elt)
Function-like use of the visitor.
|
protected java.lang.RuntimeException |
GoloElement.cantReplace(GoloElement<?> original,
GoloElement<?> replacement) |
protected java.lang.RuntimeException |
GoloElement.cantReplace(GoloElement<?> original,
GoloElement<?> replacement) |
static TryCatchFinally |
TryCatchFinally.create(java.lang.String exceptionName,
GoloElement<?> tryBlock,
GoloElement<?> catchBlock,
GoloElement<?> finallyBlock)
Creates a complete
try catch finally statement. |
static TryCatchFinally |
TryCatchFinally.create(java.lang.String exceptionName,
GoloElement<?> tryBlock,
GoloElement<?> catchBlock,
GoloElement<?> finallyBlock)
Creates a complete
try catch finally statement. |
static TryCatchFinally |
TryCatchFinally.create(java.lang.String exceptionName,
GoloElement<?> tryBlock,
GoloElement<?> catchBlock,
GoloElement<?> finallyBlock)
Creates a complete
try catch finally statement. |
protected abstract FunctionReference |
Visitors.DispatchIrVisitor.dispatchFunction(GoloElement<?> elt) |
protected java.lang.RuntimeException |
GoloElement.doesNotContain(GoloElement<?> element) |
protected void |
Augmentation.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
Augmentation.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
UnaryOperation.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
UnaryOperation.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ThrowStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ThrowStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
TypeWithMembers.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
TypeWithMembers.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
CollectionComprehension.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
CollectionComprehension.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ReferenceLookup.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ReferenceLookup.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
Union.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
Union.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
WhenClause.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
WhenClause.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
BinaryOperation.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
BinaryOperation.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
LocalReference.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
LocalReference.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ClosureReference.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ClosureReference.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ModuleImport.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ModuleImport.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ConditionalBranching.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ConditionalBranching.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ForEachLoopStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ForEachLoopStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
NamedAugmentation.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
NamedAugmentation.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
Decorator.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
Decorator.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
MatchExpression.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
MatchExpression.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
GoloAssignment.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
GoloAssignment.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected abstract void |
GoloElement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected abstract void |
GoloElement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
LoopBreakFlowStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
LoopBreakFlowStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
LoopStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
LoopStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ConstantStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ConstantStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
TryCatchFinally.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
TryCatchFinally.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
GoloFunction.replaceElement(GoloElement<?> original,
GoloElement<?> newElement) |
protected void |
GoloFunction.replaceElement(GoloElement<?> original,
GoloElement<?> newElement) |
protected void |
AbstractInvocation.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
AbstractInvocation.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
void |
Noop.replaceElement(GoloElement<?> original,
GoloElement<?> newElement) |
void |
Noop.replaceElement(GoloElement<?> original,
GoloElement<?> newElement) |
protected void |
Member.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
Member.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
CollectionLiteral.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
CollectionLiteral.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
void |
CaseStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
void |
CaseStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
void |
ToplevelElements.replaceElement(GoloElement<?> original,
GoloElement<?> newElement) |
void |
ToplevelElements.replaceElement(GoloElement<?> original,
GoloElement<?> newElement) |
protected void |
ReturnStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
ReturnStatement.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
NamedArgument.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
NamedArgument.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
Block.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
Block.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
GoloModule.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected void |
GoloModule.replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
void |
GoloElement.replaceInParentBy(GoloElement<?> newElement)
Replaces this element by the given one in its parent node.
|
Modifier and Type | Method and Description |
---|---|
GoloElement<?> |
GoloElement.ancestor(java.util.function.Predicate<GoloElement<?>> predicate)
Returns the first ancestor of this node matching the given predicate.
|
java.util.List<GoloElement<?>> |
GoloElement.children(java.util.function.Predicate<GoloElement<?>> predicate)
Returns a list the direct children of this node matching the given predicate.
|
java.util.List<GoloElement<?>> |
GoloElement.descendants(java.util.function.Predicate<GoloElement<?>> predicate)
Returns a list of all the descendants of this node matching the given predicate.
|
GoloElement<?> |
GoloElement.next(java.util.function.Predicate<GoloElement<?>> predicate)
Returns the next sibling of this element matching the given predicate.
|
GoloElement<?> |
GoloElement.previous(java.util.function.Predicate<GoloElement<?>> predicate)
Returns the previous sibling of this element matching the given predicate.
|
static GoloIrVisitor |
Visitors.visitor(java.util.Map<java.lang.Class<? extends GoloElement<?>>,FunctionReference> functions)
Creates a visitor from a map of functions.
|
static Visitors.DispatchIrVisitor |
Visitors.visitor(java.util.Map<java.lang.Class<? extends GoloElement<?>>,FunctionReference> functions,
FunctionReference defaultFunction,
Visitors.Walk walk)
Creates a visitor from a map of functions.
|
Modifier and Type | Method and Description |
---|---|
GoloCompilationException.Builder |
GoloCompilationException.Builder.report(GoloCompilationException.Problem.Type type,
GoloElement<?> source,
java.lang.String description)
Report a problem to the exception being built.
|
GoloCompilationException.Builder |
GoloCompilationException.Builder.report(GoloCompilationException.Problem.Type type,
GoloElement<?> source,
java.lang.String description,
java.lang.Throwable cause)
Report a problem to the exception being built.
|
Modifier and Type | Method and Description |
---|---|
GoloElement<?> |
MacroExpansionIrVisitor.expand(GoloElement<?> element) |
Modifier and Type | Method and Description |
---|---|
GoloElement<?> |
MacroExpansionIrVisitor.expand(GoloElement<?> element) |