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

Switch class for converting AST nodes to their textual representation as it would appear in LF code. More...

Inherits LfSwitch< MalleableString >.

Public Member Functions

MalleableString caseAction (Action object)
MalleableString caseArray (Array object)
MalleableString caseAssignment (Assignment object)
MalleableString caseAttribute (Attribute object)
MalleableString caseAttrParm (AttrParm object)
MalleableString caseBracedListExpression (BracedListExpression object)
MalleableString caseBracketListExpression (BracketListExpression object)
MalleableString caseBuiltinTriggerRef (BuiltinTriggerRef object)
MalleableString caseCode (Code code)
MalleableString caseCodeExpr (CodeExpr object)
MalleableString caseConnection (Connection object)
MalleableString caseCStyleArraySpec (CStyleArraySpec spec)
MalleableString caseDeadline (Deadline object)
MalleableString caseElement (Element object)
MalleableString caseExpression (Expression object)
MalleableString caseHost (Host host)
MalleableString caseImport (Import object)
MalleableString caseImportedReactor (ImportedReactor object)
MalleableString caseInitializer (Initializer init)
MalleableString caseInput (Input object)
MalleableString caseInstantiation (Instantiation object)
MalleableString caseIPV4Host (IPV4Host object)
MalleableString caseIPV6Host (IPV6Host object)
MalleableString caseKeyValuePair (KeyValuePair object)
MalleableString caseKeyValuePairs (KeyValuePairs object)
MalleableString caseLiteral (Literal l)
MalleableString caseMethod (Method object)
MalleableString caseMethodArgument (MethodArgument object)
MalleableString caseMode (Mode object)
MalleableString caseModel (Model object)
MalleableString caseNamedHost (NamedHost object)
MalleableString caseOutput (Output object)
MalleableString caseParameter (Parameter object)
MalleableString caseParameterReference (ParameterReference p)
MalleableString caseParenthesisListExpression (ParenthesisListExpression object)
MalleableString casePort (Port object)
MalleableString casePreamble (Preamble object)
MalleableString caseReaction (Reaction object)
MalleableString caseReactor (Reactor object)
MalleableString caseReactorDecl (ReactorDecl object)
MalleableString caseSerializer (Serializer object)
MalleableString caseStateVar (StateVar object)
MalleableString caseSTP (STP object)
MalleableString caseTardy (Tardy object)
MalleableString caseTargetDecl (TargetDecl object)
MalleableString caseTime (Time t)
MalleableString caseTimer (Timer object)
MalleableString caseTriggerRef (TriggerRef object)
MalleableString caseType (Type type)
MalleableString caseTypedVariable (TypedVariable object)
MalleableString caseTypeParm (TypeParm t)
MalleableString caseVariable (Variable object)
MalleableString caseVarRef (VarRef v)
MalleableString caseWatchdog (Watchdog object)
MalleableString caseWidthSpec (WidthSpec object)
MalleableString caseWidthTerm (WidthTerm object)
MalleableString defaultCase (EObject object)
MalleableString doSwitch (EObject eObject)

Package Functions

private< T extends EObject > MalleableString handler (T object, String name, Function< T, Expression > getTrigger, Function< T, Code > getCode)
private< E extends EObject > MalleableString list (boolean nothingIfEmpty, EList< E > items)
private< E extends EObject > MalleableString list (String separator, String prefix, String suffix, boolean nothingIfEmpty, boolean whitespaceRigid, boolean suffixSameLine, List< E > items)
 Represent the given EList as a string.

Static Package Functions

static Set< INode > getAncestorComments (INode node)
 Return all comments contained by ancestors of node that belong to said ancestors.
static ICompositeNode getNextCompositeSibling (INode node, Function< INode, INode > getNextSibling)
 Return the next composite sibling of node, as given by sequential application of getNextSibling.

Detailed Description

Switch class for converting AST nodes to their textual representation as it would appear in LF code.

Member Function Documentation

◆ caseAction()

MalleableString org.lflang.ast.ToLf.caseAction ( Action object)

◆ caseArray()

MalleableString org.lflang.ast.ToLf.caseArray ( Array object)

◆ caseAssignment()

MalleableString org.lflang.ast.ToLf.caseAssignment ( Assignment object)

◆ caseAttribute()

MalleableString org.lflang.ast.ToLf.caseAttribute ( Attribute object)

◆ caseAttrParm()

MalleableString org.lflang.ast.ToLf.caseAttrParm ( AttrParm object)

◆ caseBracedListExpression()

MalleableString org.lflang.ast.ToLf.caseBracedListExpression ( BracedListExpression object)

◆ caseBracketListExpression()

MalleableString org.lflang.ast.ToLf.caseBracketListExpression ( BracketListExpression object)

◆ caseBuiltinTriggerRef()

MalleableString org.lflang.ast.ToLf.caseBuiltinTriggerRef ( BuiltinTriggerRef object)

◆ caseCode()

MalleableString org.lflang.ast.ToLf.caseCode ( Code code)

◆ caseCodeExpr()

MalleableString org.lflang.ast.ToLf.caseCodeExpr ( CodeExpr object)

◆ caseConnection()

MalleableString org.lflang.ast.ToLf.caseConnection ( Connection object)

◆ caseCStyleArraySpec()

MalleableString org.lflang.ast.ToLf.caseCStyleArraySpec ( CStyleArraySpec spec)

◆ caseDeadline()

MalleableString org.lflang.ast.ToLf.caseDeadline ( Deadline object)

◆ caseElement()

MalleableString org.lflang.ast.ToLf.caseElement ( Element object)

◆ caseExpression()

MalleableString org.lflang.ast.ToLf.caseExpression ( Expression object)

◆ caseHost()

MalleableString org.lflang.ast.ToLf.caseHost ( Host host)

◆ caseImport()

MalleableString org.lflang.ast.ToLf.caseImport ( Import object)

◆ caseImportedReactor()

MalleableString org.lflang.ast.ToLf.caseImportedReactor ( ImportedReactor object)

◆ caseInitializer()

MalleableString org.lflang.ast.ToLf.caseInitializer ( Initializer init)

◆ caseInput()

MalleableString org.lflang.ast.ToLf.caseInput ( Input object)

◆ caseInstantiation()

MalleableString org.lflang.ast.ToLf.caseInstantiation ( Instantiation object)

◆ caseIPV4Host()

MalleableString org.lflang.ast.ToLf.caseIPV4Host ( IPV4Host object)

◆ caseIPV6Host()

MalleableString org.lflang.ast.ToLf.caseIPV6Host ( IPV6Host object)

◆ caseKeyValuePair()

MalleableString org.lflang.ast.ToLf.caseKeyValuePair ( KeyValuePair object)

◆ caseKeyValuePairs()

MalleableString org.lflang.ast.ToLf.caseKeyValuePairs ( KeyValuePairs object)

◆ caseLiteral()

MalleableString org.lflang.ast.ToLf.caseLiteral ( Literal l)

◆ caseMethod()

MalleableString org.lflang.ast.ToLf.caseMethod ( Method object)

◆ caseMethodArgument()

MalleableString org.lflang.ast.ToLf.caseMethodArgument ( MethodArgument object)

◆ caseMode()

MalleableString org.lflang.ast.ToLf.caseMode ( Mode object)

◆ caseModel()

MalleableString org.lflang.ast.ToLf.caseModel ( Model object)

◆ caseNamedHost()

MalleableString org.lflang.ast.ToLf.caseNamedHost ( NamedHost object)

◆ caseOutput()

MalleableString org.lflang.ast.ToLf.caseOutput ( Output object)

◆ caseParameter()

MalleableString org.lflang.ast.ToLf.caseParameter ( Parameter object)

◆ caseParameterReference()

MalleableString org.lflang.ast.ToLf.caseParameterReference ( ParameterReference p)

◆ caseParenthesisListExpression()

MalleableString org.lflang.ast.ToLf.caseParenthesisListExpression ( ParenthesisListExpression object)

◆ casePort()

MalleableString org.lflang.ast.ToLf.casePort ( Port object)

◆ casePreamble()

MalleableString org.lflang.ast.ToLf.casePreamble ( Preamble object)

◆ caseReaction()

MalleableString org.lflang.ast.ToLf.caseReaction ( Reaction object)

◆ caseReactor()

MalleableString org.lflang.ast.ToLf.caseReactor ( Reactor object)

◆ caseReactorDecl()

MalleableString org.lflang.ast.ToLf.caseReactorDecl ( ReactorDecl object)

◆ caseSerializer()

MalleableString org.lflang.ast.ToLf.caseSerializer ( Serializer object)

◆ caseStateVar()

MalleableString org.lflang.ast.ToLf.caseStateVar ( StateVar object)

◆ caseSTP()

MalleableString org.lflang.ast.ToLf.caseSTP ( STP object)

◆ caseTardy()

MalleableString org.lflang.ast.ToLf.caseTardy ( Tardy object)

◆ caseTargetDecl()

MalleableString org.lflang.ast.ToLf.caseTargetDecl ( TargetDecl object)

◆ caseTime()

MalleableString org.lflang.ast.ToLf.caseTime ( Time t)

◆ caseTimer()

MalleableString org.lflang.ast.ToLf.caseTimer ( Timer object)

◆ caseTriggerRef()

MalleableString org.lflang.ast.ToLf.caseTriggerRef ( TriggerRef object)

◆ caseType()

MalleableString org.lflang.ast.ToLf.caseType ( Type type)

◆ caseTypedVariable()

MalleableString org.lflang.ast.ToLf.caseTypedVariable ( TypedVariable object)

◆ caseTypeParm()

MalleableString org.lflang.ast.ToLf.caseTypeParm ( TypeParm t)

◆ caseVariable()

MalleableString org.lflang.ast.ToLf.caseVariable ( Variable object)

◆ caseVarRef()

MalleableString org.lflang.ast.ToLf.caseVarRef ( VarRef v)

◆ caseWatchdog()

MalleableString org.lflang.ast.ToLf.caseWatchdog ( Watchdog object)

◆ caseWidthSpec()

MalleableString org.lflang.ast.ToLf.caseWidthSpec ( WidthSpec object)

◆ caseWidthTerm()

MalleableString org.lflang.ast.ToLf.caseWidthTerm ( WidthTerm object)

◆ defaultCase()

MalleableString org.lflang.ast.ToLf.defaultCase ( EObject object)

◆ doSwitch()

MalleableString org.lflang.ast.ToLf.doSwitch ( EObject eObject)

◆ getAncestorComments()

Set< INode > org.lflang.ast.ToLf.getAncestorComments ( INode node)
staticpackage

Return all comments contained by ancestors of node that belong to said ancestors.

◆ getNextCompositeSibling()

ICompositeNode org.lflang.ast.ToLf.getNextCompositeSibling ( INode node,
Function< INode, INode > getNextSibling )
staticpackage

Return the next composite sibling of node, as given by sequential application of getNextSibling.

◆ handler()

private< T extends EObject > MalleableString org.lflang.ast.ToLf.handler ( T object,
String name,
Function< T, Expression > getTrigger,
Function< T, Code > getCode )
package

◆ list() [1/2]

private< E extends EObject > MalleableString org.lflang.ast.ToLf.list ( boolean nothingIfEmpty,
EList< E > items )
package

◆ list() [2/2]

private< E extends EObject > MalleableString org.lflang.ast.ToLf.list ( String separator,
String prefix,
String suffix,
boolean nothingIfEmpty,
boolean whitespaceRigid,
boolean suffixSameLine,
List< E > items )
package

Represent the given EList as a string.

Parameters
suffixThe token marking the end of the list.
separatorThe separator separating elements of the list.
prefixThe token marking the start of the list.
nothingIfEmptyWhether the result should be simplified to the empty string as opposed to just the prefix and suffix.
whitespaceRigidWhether any whitespace appearing in the
suffixSameLineWhether the suffix should be on the same line as the last element.
itemsThe list of elements to convert to a string.

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