All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.Expression.xpt Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
?IMPORT core?
?IMPORT dom?
?EXTENSION extensions::Names?
?EXTENSION extensions::Properties?
?EXTENSION extensions::Expression?
?EXTENSION extensions::Validation?
?EXTENSION extensions::SimpleTypeExtension?

?DEFINE expression FOR EqualityExpr-?
?EXPAND expression FOR left??pushOperator(op.toString())-??EXPAND expression FOR right-?
?ENDDEFINE?
	
?DEFINE expression FOR CondORExpr-?
?EXPAND expression FOR left??EXPAND expression FOREACH rights-?
?ENDDEFINE?

?DEFINE expression FOR CondANDExpr-?
?EXPAND expression FOR left??EXPAND expression FOREACH rights-?
?ENDDEFINE?

?DEFINE expression FOR CondORRights-??pushOperator("||")??EXPAND expression FOR right-??ENDDEFINE?

?DEFINE expression FOR CondANDRights-??pushOperator("&&")??EXPAND expression FOR right-??ENDDEFINE?

?DEFINE expression FOR AtomicBoolExpr??ENDDEFINE?

?DEFINE expression FOR RelationalExpr-?
?EXPAND  expression FOR left??pushOperator(op.toString())??EXPAND expression FOR right-?
?ENDDEFINE?

?DEFINE expression FOR AdditiveExpr-?
?EXPAND expression FOR left??EXPAND expression FOREACH rights-?
?ENDDEFINE?

?DEFINE expression FOR AdditiveRights-?
?pushOperator(op.toString())??EXPAND expression FOR right-?  
?ENDDEFINE?

?DEFINE expression FOR MultiplicativeExpr-?
?EXPAND expression FOR left??EXPAND expression FOREACH rights-?  
?ENDDEFINE?

?DEFINE expression FOR MultiplicativeRights-?
?pushOperator(op.toString())??EXPAND expression FOR right-?   
?ENDDEFINE?

?DEFINE expression FOR AtomicExpr-??ENDDEFINE?

?DEFINE expression FOR Variable-??ENDDEFINE?
?DEFINE expression FOR XmadslVariable-?
?IF VariableAccess::NULL==access || VariableAccess::VALUE==access??EXPAND expression(this) FOR reference??ENDIF-?
?IF VariableAccess::HAS_VALUE==access??EXPAND beginAtomicExpr(this) FOR this?(?EXPAND expression(this) FOR reference?!=null)?ENDIF-?
?IF VariableAccess::IS_VALID==access?TODO?ENDIF-?
?ENDDEFINE?

?DEFINE expression(Variable variable) FOR ReferenceableByXmadslVariable-??ENDDEFINE?

?DEFINE expression(Variable variable) FOR Property-??EXPAND beginAtomicExpr(variable) FOR this?getContext().?getAccessorMethodName()?()?EXPAND endAtomicExpr(variable) FOR this??ENDDEFINE?
?DEFINE expression(Variable variable) FOR StatusFlag-??EXPAND beginAtomicExpr(variable) FOR this??IF ApplicationSession.isInstance(eContainer.eContainer)?getContext().?name.toFirstUpper()?()?ELSE??name.toFirstUpper()?(?eContainer.eContainer.getName(false).toFirstLower()?)?ENDIF??EXPAND endAtomicExpr(variable) FOR this??ENDDEFINE? 


?DEFINE expression(Variable variable) FOR Attribute-?
?IF SimpleType.isInstance(type.dataType) && isPrimitiveWrapperType(((SimpleType)type.dataType))-?
?EXPAND beginAtomicExpr(variable) FOR this?getValue(?eContainer.getName(false).toFirstLower()?,"?name?",?registerImport(type.getFullyQualifiedName(false))?.class)?EXPAND endAtomicExpr(variable) FOR this-?
?ELSE-?
?EXPAND beginAtomicExpr(variable) FOR this??eContainer.getName(false).toFirstLower()?.?getAccessorMethodName()?()?EXPAND endAtomicExpr(variable) FOR this-?
?ENDIF-?
?ENDDEFINE?

?DEFINE expression FOR Call??EXPAND beginAtomicExpr(this) FOR this?getContext().?function.name?(?EXPAND expression FOR expr-?)?EXPAND endAtomicExpr(this) FOR this??ENDDEFINE?
?DEFINE expression FOR ParenExpr??EXPAND beginAtomicExpr(this) FOR this?(?EXPAND expression FOR expr-?)?EXPAND endAtomicExpr(this) FOR this??IF eRootContainer.getProperty("parenExpr")!=null??eRootContainer.removeProperty("parenExpr")??ENDIF??ENDDEFINE?

?DEFINE expression FOR Literal??ENDDEFINE?
?DEFINE expression FOR IntLiteral??EXPAND beginAtomicExpr(this) FOR this??number??EXPAND endAtomicExpr(this) FOR this??ENDDEFINE?
?DEFINE expression FOR StringLiteral??EXPAND beginAtomicExpr(this) FOR this?"?string?"?EXPAND endAtomicExpr(this) FOR this??ENDDEFINE?
?DEFINE expression FOR BoolLiteral??ENDDEFINE?
?DEFINE expression FOR TrueLiteral??EXPAND beginAtomicExpr(this) FOR this?Boolean.TRUE?EXPAND endAtomicExpr(this) FOR this??ENDDEFINE?
?DEFINE expression FOR FalseLiteral??EXPAND beginAtomicExpr(this) FOR this?Boolean.FALSE?EXPAND endAtomicExpr(this) FOR this??ENDDEFINE?

?DEFINE beginAtomicExpr(AtomicExpr atomicExpr) FOR emf::EObject??popOperator()??ENDDEFINE?

?DEFINE beginAtomicExpr(AtomicExpr atomicExpr) FOR Property-?
?IF !type.isPrimitiveWrapperType()??EXPAND objectExpressionValue(atomicExpr) FOR this??ELSE??popOperator()??ENDIF-?
?ENDDEFINE?

?DEFINE beginAtomicExpr(AtomicExpr atomicExpr) FOR Attribute-?
?IF !SimpleType.isInstance(type.dataType) || !((SimpleType)type.dataType).isPrimitiveWrapperType()??EXPAND objectExpressionValue(atomicExpr) FOR this??ELSE??popOperator()??ENDIF-?
?ENDDEFINE?

?DEFINE beginAtomicExpr(AtomicExpr atomicExpr) FOR StringLiteral-??IF !Call.isInstance(eContainer)??EXPAND objectExpressionValue(atomicExpr) FOR this-??ELSE??ENDIF??ENDDEFINE?

?DEFINE beginAtomicExpr(AtomicExpr atomicExpr) FOR ParenExpr-?
?IF !expr.isPrimitiveWrapperType()??EXPAND objectExpressionValue(this) FOR this??atomicExpr.eRootContainer.setProperty("parenExpr","true")??ELSE??popOperator()??ENDIF-?
?ENDDEFINE?

?DEFINE beginAtomicExpr(AtomicExpr atomicExpr) FOR Call-?
?IF !function.resultType.isPrimitiveWrapperType()??EXPAND objectExpressionValue(this) FOR this??ELSE??popOperator()??ENDIF-?
?ENDDEFINE?

?DEFINE objectExpressionValue(AtomicExpr atomicExpr) FOR emf::EObject-?
?LET popOperator() AS operator-?
?IF operator=="==" || operator=="!="?.equals(?atomicExpr.eRootContainer.setProperty("equals","true")-?
?ELSE??operator-?
?ENDIF-?
?ENDLET-?
?IF atomicExpr.nextOperator()=="!="??IF atomicExpr.eRootContainer.getProperty("parenExpr")==null?!(?atomicExpr.eRootContainer.setProperty("equals","true")??ENDIF??ENDIF-?
?ENDDEFINE?

?DEFINE endAtomicExpr(AtomicExpr atomicExpr)FOR emf::EObject??IF atomicExpr.eRootContainer.getProperty("equals")!=null?)?atomicExpr.eRootContainer.removeProperty("equals")??ENDIF??ENDDEFINE?




© 2015 - 2024 Weber Informatics LLC | Privacy Policy