EMFHelpers

public class EMFHelpers

Methods

addAttribute

public static void addAttribute(BaseNode node, DeclRef attribute, Collection<Expr> arguments)

addAttribute

public static void addAttribute(BaseNode node, DeclRef attribute)

addQueueSizeAttribute

public static void addQueueSizeAttribute(ComponentDecl node, int queueSize)

addRuntimeAttribute

public static void addRuntimeAttribute(ComponentDecl node, boolean multithreaded)

createAbortDeclRef

public static BuiltinDeclRef createAbortDeclRef()

createArrayDeclRef

public static BuiltinDeclRef createArrayDeclRef()

createArrayDereferenceExpr

public static ArrayDereferenceExpr createArrayDereferenceExpr(Expr base, Expr index)

createArrayEventSource

public static ArrayEventSource createArrayEventSource(EventSource base, Pattern arrayVariable, Expr guard)

createArrayLiteralExpr

public static ArrayLiteralExpr createArrayLiteralExpr(Collection<Expr> values)

createArrayTypeRepr

public static TypeReferenceRepr createArrayTypeRepr(TypeRepr itemType, int arraySize)

createAssertDeclRef

public static BuiltinDeclRef createAssertDeclRef()

createAssignmentExpr

public static AssignmentExpr createAssignmentExpr(Expr target, Expr value)

createAttribute

public static Attribute createAttribute(DeclRef attribute, Collection<Expr> arguments)

createAttribute

public static Attribute createAttribute(DeclRef attribute)

createAttributeDecl

public static AttributeDecl createAttributeDecl(String name, Collection<ParameterDecl> arguments)

createBaseDeclRef

public static BuiltinDeclRef createBaseDeclRef(String member)

createBecomeStmt

public static BecomeStmt createBecomeStmt(Expr returnValue)

createBinaryOperationExpr

public static BinaryOperationExpr createBinaryOperationExpr(Expr left, BinaryOperation operation, Expr right)

createBlockExpr

public static BlockExpr createBlockExpr()

createBlockExpr

public static BlockExpr createBlockExpr(Collection<Stmt> body)

createBlockExpr

public static BlockExpr createBlockExpr(Collection<Stmt> body, Expr value)

createBoolDeclRef

public static BuiltinDeclRef createBoolDeclRef()

createBoolTypeRepr

public static TypeRepr createBoolTypeRepr()

createBoundDeclRef

public static BoundDeclRef createBoundDeclRef(ValueDecl decl)

createBoundedDeclRef

public static BuiltinDeclRef createBoundedDeclRef()

createBoundedIntTypeRepr

public static TypeReferenceRepr createBoundedIntTypeRepr(int lowerBound, int upperBound)

createBoundedTypeRepr

public static TypeReferenceRepr createBoundedTypeRepr(int lowerBound, int upperBound)

createBreakStmt

public static BreakStmt createBreakStmt()

createBreakStmt

public static BreakStmt createBreakStmt(LoopStmt loop)

createBreakStmt

public static BreakStmt createBreakStmt(String loopName)

createBuiltinDeclRef

public static BuiltinDeclRef createBuiltinDeclRef(String member, String module)

createBuiltinDeclRef

public static BuiltinDeclRef createBuiltinDeclRef(String member, String module, int index)

createCallExpr

public static CallExpr createCallExpr(Expr function, Collection<Expr> arguments)

createCharDeclRef

public static BuiltinDeclRef createCharDeclRef()

createCharTypeRepr

public static TypeReferenceRepr createCharTypeRepr()

createComponentDecl

public static ComponentDecl createComponentDecl(String name)

createCompoundEventHandler

public static CompoundEventHandler createCompoundEventHandler(Collection<CompoundEventHandlerClause> clauses, EventHandler fallback)

createCompoundEventHandlerClause

public static CompoundEventHandlerClause createCompoundEventHandlerClause(EventHandler value)

createCompoundEventHandlerClause

public static CompoundEventHandlerClause createCompoundEventHandlerClause(Expr guard, EventHandler value)

createConstructorDecl

public static ConstructorDecl createConstructorDecl(BlockExpr body)

createContinueStmt

public static ContinueStmt createContinueStmt()

createContinueStmt

public static ContinueStmt createContinueStmt(LoopStmt loop)

createContinueStmt

public static ContinueStmt createContinueStmt(String loopName)

createDeclStmt

public static DeclStmt createDeclStmt(VariableDecl variable)

createEnumCaseDecl

public static EnumCaseDecl createEnumCaseDecl(String name)

createEnumCaseDecl

public static EnumCaseDecl createEnumCaseDecl(String name, Expr value)

createEnumCaseDecl

public static EnumCaseDecl createEnumCaseDecl(String name, Collection<ParameterDecl> fields)

createEnumCasePattern

public static EnumCasePattern createEnumCasePattern(DeclRef enumCase, Collection<ParameterDecl> parameters)

createEnumDecl

public static EnumDecl createEnumDecl(String name, Collection<EnumCaseDecl> clauses)

createEqDeclRef

public static BuiltinDeclRef createEqDeclRef()

createEventStateDecl

public static EventStateDecl createEventStateDecl(String name)

createExecutionStateDecl

public static ExecutionStateDecl createExecutionStateDecl(String name, BlockExpr body)

createExprEventHandler

public static ExprEventHandler createExprEventHandler(Expr action)

createExternalCodeExpr

public static ExternalCodeExpr createExternalCodeExpr(String code)

createExternalCodeExpr

public static ExternalCodeExpr createExternalCodeExpr(String code, TypeRepr type)

createExternalComponentDecl

public static ComponentDecl createExternalComponentDecl(String name, String providedPortName, PortDecl providedPort)

createExternalComponentDecl

public static ComponentDecl createExternalComponentDecl(String name, Collection<FieldDecl> providedPort)

createExternalConstantDecl

public static ExternalConstantDecl createExternalConstantDecl(String name, TypeRepr declaredType, Expr initialiser)

createExternalFunctionDecl

public static ExternalFunctionDecl createExternalFunctionDecl(String name, GenericSignatureRepr genericSignature, Collection<ParameterDecl> arguments, TypeRepr returnType)

createExternalFunctionDecl

public static ExternalFunctionDecl createExternalFunctionDecl(String name, GenericSignatureRepr genericSignature, Collection<ParameterDecl> arguments, TypeRepr returnType, Expr body)

createExternalTypeDecl

public static ExternalTypeDecl createExternalTypeDecl(String name)

createExternalTypeDecl

public static ExternalTypeDecl createExternalTypeDecl(String name, GenericSignatureRepr genericSignature)

createFalseDeclRef

public static BuiltinDeclRef createFalseDeclRef()

createFieldDecl

public static FieldDecl createFieldDecl(String name, TypeRepr declaredType)

createFieldDecl

public static FieldDecl createFieldDecl(String name, TypeRepr declaredType, ConstantMode constantMode)

createFieldEventSource

public static FieldEventSource createFieldEventSource(EventSource base, DeclRef field)

createForStmt

public static ForStmt createForStmt(ParameterDecl rangeVariable, Expr range, BlockExpr body)

createForStmt

public static ForStmt createForStmt(String label, ParameterDecl rangeVariable, Expr range, BlockExpr body)

createFunctionArgument

public static ParameterDecl createFunctionArgument(String name, TypeRepr argumentType)

createFunctionDecl

public static FunctionDecl createFunctionDecl(String name, GenericSignatureRepr genericSignature, Collection<ParameterDecl> arguments, TypeRepr returnType, Expr value)

createFunctionInterfaceDecl

public static FunctionInterfaceDecl createFunctionInterfaceDecl(String name, Collection<ParameterDecl> arguments, TypeRepr returnType)

createFunctionTypeRepr

public static FunctionTypeRepr createFunctionTypeRepr(Collection<TypeRepr> arguments, TypeRepr result)

createGenericRequirementRepr

public static GenericRequirementRepr createGenericRequirementRepr(DeclRef typeClass, Collection<TypeRepr> arguments)

createGenericSignatureRepr

public static GenericSignatureRepr createGenericSignatureRepr(Collection<TypeParamDecl> arguments, Collection<GenericRequirementRepr> requirements)

createIfExpr

public static IfExpr createIfExpr(Expr guard, Expr thenValue, Expr elseValue)

createIllegalEventHandler

public static IllegalEventHandler createIllegalEventHandler()

createIntDeclRef

public static BuiltinDeclRef createIntDeclRef()

createIntTypeRepr

public static TypeReferenceRepr createIntTypeRepr()

createInvariantDecl

public static InvariantDecl createInvariantDecl(Expr invariant)

createLiteralChar

public static LiteralChar createLiteralChar(char value)

createLiteralExpr

public static LiteralExpr createLiteralExpr(Literal literal)

createLiteralInt

public static LiteralInt createLiteralInt(int value)

createLiteralPattern

public static LiteralPattern createLiteralPattern(Literal value)

createLiteralString

public static LiteralString createLiteralString(String value)

createLiteralTypeRepr

public static LiteralTypeRepr createLiteralTypeRepr(Literal literal)

createMatchClause

public static MatchClause createMatchClause(Pattern pattern, Expr value)

createMatchExpr

public static MatchExpr createMatchExpr(Expr argument)

createMatchExpr

public static MatchExpr createMatchExpr(String label, Expr argument)

createMatchExpr

public static MatchExpr createMatchExpr(Expr argument, Collection<MatchClause> clauses)

createMatchExpr

public static MatchExpr createMatchExpr(String label, Expr argument, Collection<MatchClause> clauses)

createMemberReferenceExpr

public static MemberReferenceExpr createMemberReferenceExpr(Expr base, DeclRef field)

createMemberReferenceExpr

public static MemberReferenceExpr createMemberReferenceExpr(Expr base, ValueDecl field)

createModuleDecl

public static ModuleDecl createModuleDecl(String name)

createModuleDecl

public static ModuleDecl createModuleDecl(String name, Collection<Decl> decls)

createNilDeclRef

public static BuiltinDeclRef createNilDeclRef()

createNilTypeRepr

public static TypeReferenceRepr createNilTypeRepr()

createNonDetClause

public static NonDetClause createNonDetClause(Expr value)

createNonDetClause

public static NonDetClause createNonDetClause(Expr guard, Expr value)

createNonDetExpr

public static NonDetExpr createNonDetExpr(Collection<NonDetClause> clauses)

createNonDetExpr

public static NonDetExpr createNonDetExpr(Collection<NonDetClause> clauses, Expr fallback)

createOptionalExpr

public static OptionalExpr createOptionalExpr(Expr value)

createOrdDeclRef

public static BuiltinDeclRef createOrdDeclRef()

createParameterDecl

public static ParameterDecl createParameterDecl(String name)

createParameterDecl

public static ParameterDecl createParameterDecl(String name, TypeRepr declaredType)

createPortDecl

public static PortDecl createPortDecl(String name)

createPortDecl

public static PortDecl createPortDecl(String name, Collection<FunctionInterfaceDecl> functions, Collection<SignalDecl> signals)

createPortDecl

public static PortDecl createPortDecl(String name, Collection<ValueDecl> members)

createQualifedImportDecl

public static ImportDecl createQualifedImportDecl(DeclRef module)

createQueueAttributeDeclRef

public static BuiltinDeclRef createQueueAttributeDeclRef()

createRangeDeclRef

public static BuiltinDeclRef createRangeDeclRef()

createRecordDecl

public static RecordDecl createRecordDecl(String name, GenericSignatureRepr genericSignature, Collection<Decl> members)

createReferenceTypeRepr

public static ReferenceTypeRepr createReferenceTypeRepr(ReferenceKind kind, TypeRepr base)

createRepresentsDeclRef

public static BuiltinDeclRef createRepresentsDeclRef()

createRequalifedImportDecl

public static ImportDecl createRequalifedImportDecl(DeclRef module, String name)

createReturnStmt

public static ReturnStmt createReturnStmt(Expr returnValue)

createRuntimeDeclRef

public static BuiltinDeclRef createRuntimeDeclRef()

createSelfDeclRef

public static DeclRef createSelfDeclRef()

createSignalDecl

public static SignalDecl createSignalDecl(String name, SignalDirection direction, Collection<ParameterDecl> arguments)

createSpontaneousTransition

public static Transition createSpontaneousTransition(Expr guard, Expr action)

createStateMachineDecl

public static StateMachineDecl createStateMachineDecl(String name)

createStateMachineDecl

public static StateMachineDecl createStateMachineDecl(String name, Collection<Decl> localDecls)

createStorageDeclPattern

public static StorageDeclPattern createStorageDeclPattern(ParameterDecl decl)

createStringDeclRef

public static BuiltinDeclRef createStringDeclRef()

createStringTypeRepr

public static TypeReferenceRepr createStringTypeRepr()

createTransition

public static Transition createTransition(Expr guard, EventSource source, DeclRef event, Collection<ParameterDecl> arguments, EventHandler handler)

createTrueDeclRef

public static BuiltinDeclRef createTrueDeclRef()

createTypeAliasDecl

public static TypeAliasDecl createTypeAliasDecl(String name, GenericSignatureRepr genericSignature, TypeRepr underlyingType)

createTypeClassDecl

public static TypeClassDecl createTypeClassDecl(String name, GenericSignatureRepr genericSignature, Collection<FunctionInterfaceDecl> functions)

createTypeClassInstanceDecl

public static TypeClassInstanceDecl createTypeClassInstanceDecl(DeclRef typeClass, GenericSignatureRepr genericSignature, Collection<TypeRepr> arguments, Collection<TypeAliasDecl> associatedTypes, Collection<FunctionImplementationDecl> functions)

createTypeReferenceRepr

public static TypeReferenceRepr createTypeReferenceRepr(DeclRef decl)

createTypeReferenceRepr

public static TypeReferenceRepr createTypeReferenceRepr(DeclRef decl, Collection<TypeRepr> arguments)

createTypeVariableTypeParamDecl

public static TypeVariableTypeParamDecl createTypeVariableTypeParamDecl(String name)

createUnboundDeclRef

public static UnboundDeclRef createUnboundDeclRef(String name)

createUndefinedExpr

public static UndefinedExpr createUndefinedExpr()

createUndefinedExpr

public static UndefinedExpr createUndefinedExpr(TypeRepr type)

createUnqualifedImportDecl

public static ImportDecl createUnqualifedImportDecl(DeclRef module)

createUnreliableDeclRef

public static BuiltinDeclRef createUnreliableDeclRef()

createUnreliableSpontaneousTransition

public static Transition createUnreliableSpontaneousTransition(Expr guard, Expr action)

createUnusedAttributeDeclRef

public static BuiltinDeclRef createUnusedAttributeDeclRef()

createValueTypeParamDecl

public static ValueTypeParamDecl createValueTypeParamDecl(String name, TypeRepr valueType)

createVariableDecl

public static VariableDecl createVariableDecl(String name, ConstantMode constantMode, TypeRepr declaredType)

createVariableDecl

public static VariableDecl createVariableDecl(String name, ConstantMode constantMode, TypeRepr declaredType, Expr initialiser)

createVariableExpr

public static VariableExpr createVariableExpr(DeclRef variable)

createVariablePattern

public static VariablePattern createVariablePattern(DeclRef variable)

createVerifyDeclRef

public static BuiltinDeclRef createVerifyDeclRef()

createWhileStmt

public static WhileStmt createWhileStmt(Expr predicate, BlockExpr body)

createWhileStmt

public static WhileStmt createWhileStmt(String label, Expr predicate, BlockExpr body)

createWhileStmt

public static WhileStmt createWhileStmt(Expr predicate, Collection<Stmt> bodyContents)

createWildcardFunctionArgument

public static ParameterDecl createWildcardFunctionArgument(TypeRepr argumentType)

createWildcardPattern

public static WildcardPattern createWildcardPattern()

createnilDeclRef

public static BuiltinDeclRef createnilDeclRef()